ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » System.OutOfMemoryException exception using MQAX200 (C#)

Post new topic  Reply to topic
 System.OutOfMemoryException exception using MQAX200 (C#) « View previous topic :: View next topic » 
Author Message
fdeback
PostPosted: Tue Jul 27, 2004 5:29 am    Post subject: System.OutOfMemoryException exception using MQAX200 (C#) Reply with quote

Newbie

Joined: 27 Jul 2004
Posts: 4

I am using the MQAX200 API from C# in order to poll a queue for arriving messages on a Win2k platform. On some servers where my application is installed, we get systematically a System.OutOfMemoryException.

The different steps of my source code perform the following operations:

- create a serviced component helper object that will do the actual work and manages the transaction.
- within this serviced component:
Code:
m_qSession = new MQSessionClass();
m_qManager = (MQQueueManager)m_qSession.AccessQueueManager(queueManagerName);
m_q = (MQQueue)m_qManager.AccessQueue(queueName, (int)MQ.MQOO_INPUT_AS_Q_DEF, "", "", "");

MQGetMessageOptions qGetMessageOptions = (MQGetMessageOptions)m_qSession.AccessGetMessageOptions();
qGetMessageOptions.Options += (int) MQ.MQGMO_WAIT;
qGetMessageOptions.WaitInterval = (int)TIME_TO_WAIT;
qGetMessageOptions.Options += (int) MQ.MQGMO_SYNCPOINT;
qGetMessage = (MQMessage)m_qSession.AccessMessage();

try
{
    m_q.Get(qGetMessage, qGetMessageOptions, Type.Missing);
}
catch(COMException err)
{
   if ( MQRC_NO_MSG_AVAILABLE == m_q.ReasonCode )
   {
       ContextUtil.SetAbort();
       if(m_qManager != null)
       {
           m_qManager.Disconnect();
       }
       return qGetMessage;
   }
   throw err;
}
- in case an error was thrown in the serviced component: dispose the serviced component.
- start this process all over again.

For some reason, it seems that the serviced component cannot be disposed correctly: I have the impression that the number of threads within the dllhost keeps increasing, until the system runs out of memory.

Any idea about the reason for this error?

Thanks!
Back to top
View user's profile Send private message
dpchiesa
PostPosted: Fri Aug 13, 2004 4:44 am    Post subject: MQAX, C# and interop Reply with quote

Apprentice

Joined: 29 May 2002
Posts: 46

sorry I don't have any good ideas here, but..

> I am using the MQAX200 API from C# ...

have you tried using the amqdnet.dll that ships with wmq5,3 CSD05 and above?
_________________
-dpchiesa
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Aug 13, 2004 11:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Have you tried debugging what is going on in your ComExceptionError block?

What if an exception gets thrown in your Abort/rollback process

If the disconnect is not clean because of additional problems before the code even hits it and you are running this in a poll process .....

Enjoy
Back to top
View user's profile Send private message Send e-mail
fdeback
PostPosted: Mon Aug 23, 2004 8:20 am    Post subject: Reply with quote

Newbie

Joined: 27 Jul 2004
Posts: 4

The ComExceptionError block is executed completely, no errors occur in that part. I didn't put the entire source code in my orinigal post, but there is an outer try-catch block managing exceptions that occur in the part that I posted.

As for the amqdnet.dll shipped with wmq5,3 CSD05: no, didn't try that one. The application has to work with mq5.2 as well...
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Aug 23, 2004 9:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You know that MQ 5.2 is out of support and has been for about 8 months? I'd suggest that you use this issue as your reason to push forward to WMQ 5.3.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » System.OutOfMemoryException exception using MQAX200 (C#)
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.