Hi,
In our c# application we are trying to find the Message count and thats throwing the System.OutOfMemoryException. Can someone please help me resolve this error? I'm positive that the system has enough memory available.
int count = 0;
Open();
count=asyncReadQueue.GetAllMessages().Length();
The call stack looks like this:
055 9:19:43 AM [6068] ERROR: ----------------------------------------------
00000056 9:19:52 AM [6068] ERROR: -----------------Excpetion -------------------
00000057 9:19:52 AM [6068] ERROR: Exception of type 'System.OutOfMemoryException' was thrown.
00000058 9:19:52 AM [6068] ERROR: TargetSite = .ctor
00000059 9:19:52 AM [6068] ERROR: at System.Messaging.Interop.MessagePropertyVariants..ctor()
00000060 9:19:52 AM [6068] at System.Messaging.Message..ctor(MessagePropertyFilter filter)
00000061 9:19:52 AM [6068] at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType
transactionType)
00000062 9:19:52 AM [6068] at System.Messaging.MessageEnumerator.get_Current()
00000063 9:19:52 AM [6068] at System.Messaging.MessageQueue.GetAllMessages()
00000064 9:19:52 AM [6068] at Acc.Messaging.AccMsmqNet.get_MessageCount()