Hi,
I'm working on an application that takes csv files then converts it to XML.
It then write the XML to a msmq where another service is reading the queue
and sends it to the DB.
My question is:
My application flies (when using the Message object to wrap my data in a
non-transactional Q.
When using MessageQueueTransaction in a transactional Q the memory usage (in
task manager) keeps getting larger (as if GC never cleans up)
until my application throws OutOfMemoryException.
The problem is I HAVE to use transactional Queues since the modules that
writes data to the DB can only read transactional queues.
Even if i didn't have to, I would like to know why do I run out of memory
with Transactional queues.
I run out of memory depending on the size and number of the CSV files.
My code is simple...
I create Talk2Q once and i loop on the Send() method
MessageQueueTransaction m;
MessageQueue msgQ;
public Talk2Q(string QName){
msgQ=new MessageQueue(QName)
}
public void Send(string data){
try{
m=new MessageQueueTransaction();
m.Begin();
msgQ.Formatter=new ActiveXMessageFormatter();
msgQ.Send(msg.ToString(),"RTPROS Message",m);
m.Commit();
m=null; //To make sure GC notices it ;)
}catch(Exception e){
m.Abort();
Console.WriteLine("Msg Aborted\n\n"+e.Message+e.StackTrace)
}
Maybe do i need to create the MessageQueueTransaction ONCE only???
Thanks alot!