473,703 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MQ memory leak

Hi,

I have implemented a Service that is responsible for getting messages from a
MS MQ located on a remote machine. I'm getting memory leak from time to time
(???). In some situation, it is easier to reproduce (e.g.: remote machine
not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I should say
that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR, MessageProperty Filter,
......)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
..NET 1.1

Thanks,
José
Nov 15 '05 #1
17 4805
Jose,

Are you calling Dispose on all of the classes that you are using? For
example, are you calling Dispose on the MessageQueue instance you are using?
This could be a major source of any leaks you might be seeing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from a MS MQ located on a remote machine. I'm getting memory leak from time to time (???). In some situation, it is easier to reproduce (e.g.: remote machine
not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I should say that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR, MessageProperty Filter,
.....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José

Nov 15 '05 #2
In fact, before entering my loop, I create an instance of a class that will
try to fetch messages. This class has a private member :
private MessageQueue m_mq;

Within the method called by the main loop, whenever I try to fetch a
message, I use m_mq.Receive(Ti meToWait).
In case a message is retrieved, I pass it back to my main loop. In any other
situation, I return a null.

There is a situation where I call Dispose() method on my "m_mq" member. This
is when I get an error of type MessageQueueErr orCode.QueueNot Available. In
such a case, I apply the following algorithm:
m_mq.Dispose();
m_mq=null;
MessageQueue.Cl earConnectionCa che();
m_mq = new MessageQueue(m_ strQueueName);
MessageQueue.En ableConnection = true;
When the main loop receive the answer (either a message or a null), it will
process the message and call the method again to get the next message.

In that sense, I think I did not forgot to call any Dispose().

José

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> a écrit
dans le message de news:et******** ******@TK2MSFTN GP10.phx.gbl...
Jose,

Are you calling Dispose on all of the classes that you are using? For
example, are you calling Dispose on the MessageQueue instance you are using? This could be a major source of any leaks you might be seeing.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from
a
MS MQ located on a remote machine. I'm getting memory leak from time to

time
(???). In some situation, it is easier to reproduce (e.g.: remote

machine not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I should

say
that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR, MessageProperty Filter, .....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José


Nov 15 '05 #3
>
Are you calling Dispose on all of the classes that you are using? For
example, are you calling Dispose on the MessageQueue instance you are using? This could be a major source of any leaks you might be seeing.
Why should we call Dispose() manually? Shouldn't be calling Close() is
enough? I thought dispose will be called when the object is about to be
garbage collected and shouldn't be called manualy.

/m

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from
a
MS MQ located on a remote machine. I'm getting memory leak from time to

time
(???). In some situation, it is easier to reproduce (e.g.: remote

machine not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I should

say
that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR, MessageProperty Filter, .....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José


Nov 15 '05 #4
Muscha,

They are doing the same thing. For some classes though, it fits better
to have a method named "Close" as opposed to "Dispose" when dealing with the
resource (for example, on a FileStream, if you Dispose it, it might indicate
you are getting rid of the file, as opposed to closing it).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Muscha" <mu****@no.spam .net> wrote in message
news:Ob******** *****@TK2MSFTNG P09.phx.gbl...

Are you calling Dispose on all of the classes that you are using? For
example, are you calling Dispose on the MessageQueue instance you are

using?
This could be a major source of any leaks you might be seeing.


Why should we call Dispose() manually? Shouldn't be calling Close() is
enough? I thought dispose will be called when the object is about to be
garbage collected and shouldn't be called manualy.

/m

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from
a
MS MQ located on a remote machine. I'm getting memory leak from time

to time
(???). In some situation, it is easier to reproduce (e.g.: remote machine not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I
should say
that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR,

MessageProperty Filter, .....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José



Nov 15 '05 #5
Are you receiving from a remote computer ?
If yes, does the leak happen when remote is not available ?

Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no rights.
..

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from a MS MQ located on a remote machine. I'm getting memory leak from time to time (???). In some situation, it is easier to reproduce (e.g.: remote machine
not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I should say that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR, MessageProperty Filter,
.....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José

Nov 15 '05 #6
As far as I see it, it append "only" when the remote is not available

José
"Doron Juster [MSFT]" <Do****@Online. Microsoft.com> wrote in message
news:em******** ******@tk2msftn gp13.phx.gbl...
Are you receiving from a remote computer ?
If yes, does the leak happen when remote is not available ?

Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no rights. .

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from
a
MS MQ located on a remote machine. I'm getting memory leak from time to

time
(???). In some situation, it is easier to reproduce (e.g.: remote

machine not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I should

say
that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR, MessageProperty Filter, .....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José


Nov 15 '05 #7
Thanks, I'll see if I can reproduce this.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
..

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:uz******** ******@tk2msftn gp13.phx.gbl...
As far as I see it, it append "only" when the remote is not available

José
"Doron Juster [MSFT]" <Do****@Online. Microsoft.com> wrote in message
news:em******** ******@tk2msftn gp13.phx.gbl...
Are you receiving from a remote computer ?
If yes, does the leak happen when remote is not available ?

Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no

rights.
.

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

I have implemented a Service that is responsible for getting messages from
a
MS MQ located on a remote machine. I'm getting memory leak from time
to time
(???). In some situation, it is easier to reproduce (e.g.: remote machine not available). After about 1 day, I get a usage of 300MB of memory.
I have used .NET Memory Profiler tool to try to see where the leak is
located. For all the leaky instances, I can see the following (I
should say
that is not too clear what it is trying to show...):

Message..ctor(M essagePropertyF ilter)
MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR,

MessageProperty Filter, .....)
MessageQueue.Re ceive(TimeSpan)
MQEvlReceiver.R eceive(int) <--------My appl.
MQReception.DoW ork() <--------My appl.

I have check and re-check my code, I cannot see any problem with it.

Does anyone knows about a leak with MQ in a similar case?

Here is my config:
W2K sp3 english
.NET 1.1

Thanks,
José



Nov 15 '05 #8
Any news?

By the way, I have posted a detail about what I do just above in the same
thread.

José
"Doron Juster [MSFT]" <Do****@Online. Microsoft.com> wrote in message
news:uG******** ******@TK2MSFTN GP09.phx.gbl...
Thanks, I'll see if I can reproduce this.

--
This posting is provided "AS IS" with no warranties, and confers no rights. .

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:uz******** ******@tk2msftn gp13.phx.gbl...
As far as I see it, it append "only" when the remote is not available

José
"Doron Juster [MSFT]" <Do****@Online. Microsoft.com> wrote in message
news:em******** ******@tk2msftn gp13.phx.gbl...
Are you receiving from a remote computer ?
If yes, does the leak happen when remote is not available ?

Thanks, Doron
--
This posting is provided "AS IS" with no warranties, and confers no

rights.
.

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
> Hi,
>
> I have implemented a Service that is responsible for getting messages
from
a
> MS MQ located on a remote machine. I'm getting memory leak from time to time
> (???). In some situation, it is easier to reproduce (e.g.: remote

machine
> not available). After about 1 day, I get a usage of 300MB of memory.
> I have used .NET Memory Profiler tool to try to see where the leak
is > located. For all the leaky instances, I can see the following (I

should say
> that is not too clear what it is trying to show...):
>
> Message..ctor(M essagePropertyF ilter)
> MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR,

MessageProperty Filter,
> .....)
> MessageQueue.Re ceive(TimeSpan)
> MQEvlReceiver.R eceive(int) <--------My appl.
> MQReception.DoW ork() <--------My appl.
>
> I have check and re-check my code, I cannot see any problem with it.
>
> Does anyone knows about a leak with MQ in a similar case?
>
> Here is my config:
> W2K sp3 english
> .NET 1.1
>
> Thanks,
> José
>
>



Nov 15 '05 #9
Not yet, sorry.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
..

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:uz******** ******@TK2MSFTN GP11.phx.gbl...
Any news?

By the way, I have posted a detail about what I do just above in the same
thread.

José
"Doron Juster [MSFT]" <Do****@Online. Microsoft.com> wrote in message
news:uG******** ******@TK2MSFTN GP09.phx.gbl...
Thanks, I'll see if I can reproduce this.

--
This posting is provided "AS IS" with no warranties, and confers no

rights.
.

"José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
news:uz******** ******@tk2msftn gp13.phx.gbl...
As far as I see it, it append "only" when the remote is not available

José
"Doron Juster [MSFT]" <Do****@Online. Microsoft.com> wrote in message
news:em******** ******@tk2msftn gp13.phx.gbl...
> Are you receiving from a remote computer ?
> If yes, does the leak happen when remote is not available ?
>
> Thanks, Doron
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> .
>
> "José Joye" <jo*******@KILL THESPAMSbluewin .ch> wrote in message
> news:e7******** ******@TK2MSFTN GP10.phx.gbl...
> > Hi,
> >
> > I have implemented a Service that is responsible for getting messages from
> a
> > MS MQ located on a remote machine. I'm getting memory leak from time
to
> time
> > (???). In some situation, it is easier to reproduce (e.g.: remote
machine
> > not available). After about 1 day, I get a usage of 300MB of
memory. > > I have used .NET Memory Profiler tool to try to see where the leak

is > > located. For all the leaky instances, I can see the following (I

should
> say
> > that is not too clear what it is trying to show...):
> >
> > Message..ctor(M essagePropertyF ilter)
> > MessageQueue.Re ceiveCurrent(Ti meSpan, int, IntPTR,
MessageProperty Filter,
> > .....)
> > MessageQueue.Re ceive(TimeSpan)
> > MQEvlReceiver.R eceive(int) <--------My appl.
> > MQReception.DoW ork() <--------My appl.
> >
> > I have check and re-check my code, I cannot see any problem with it. > >
> > Does anyone knows about a leak with MQ in a similar case?
> >
> > Here is my config:
> > W2K sp3 english
> > .NET 1.1
> >
> > Thanks,
> > José
> >
> >
>
>



Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3410
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? In nut shell, what is/are the realtion/s between the Memory Leak and Memory Corruption. Juts Theoritical Assumtion below:
4
6086
by: Don Nell | last post by:
Hello Why is there a memory leak when this code is executed. for(;;) { ManagementScope scope = new ManagementScope(); scope.Options.Username="username"; scope.Options.Password="password"; scope.Path.Path=@"\\pc\root\cimv2";
20
8110
by: jeevankodali | last post by:
Hi I have an .Net application which processes thousands of Xml nodes each day and for each node I am using around 30-40 Regex matches to see if they satisfy some conditions are not. These Regex matches are called within a loop (like if or for). E.g. for(int i = 0; i < 10; i++) { Regex r = new Regex();
23
4554
by: James | last post by:
The following code will create memory leaks!!! using System; using System.Diagnostics; using System.Data; using System.Data.SqlClient; namespace MemoryLeak
8
8547
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of each object within my JS app to help locate my problem? Thanks
7
6934
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports the status of the machines. Upon we follow the .NET object lifetime recommendations the application is constantly consuming more memory! The problem is on the ManagementObjectSearch, upon we Dispose the object it seems that is not releasing the...
3
5323
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". Anybody know anything about this? Does *Javascript* leak memeory, or does the *browser* leak memory?
7
15706
by: Ragnar Agustsson | last post by:
Hi all I have been wandering about the best way to sandbox memory leaks in 3rd party libraries when using them from the .Net framework. I have a 3rd party library, written in C++, that leaks a lot of memory but I still had to use it. 1. After using DLLImport and seeing the memory leak I tried to load and
22
9343
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a memory leak someplace. I can not detect the memory leak by running several reports by hand, but when I run tha app as a servrice and process few hundred reports there is significant memory leak. The application can consume over 1GB of memory where it...
0
8759
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8669
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8963
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.