mqsvc.exe doesn't release memory


  • Hi, all.

    First of all, please excuse any english language mistakes in the following description, because, I'm not a native speaker and well, I can't write it perfectly.

    I'm trying to create a .NET (4.0) service for remote/transactional/asynchronous reception of recoverable messages from several queues. So, first, I use BeginPeek method and then Receive method in a TransactionScope (which implicitly uses MSDTC).

    The problem is the mqsvc.exe of the host machine (win7/2k8r2 sp1) running my service, which does nothing else (and certainly nothing related to the reception/hosting of messages, MSMQ is empty and clean). mqsvc.exe memory allocation grows and it never releases any memory. All MSMQ registry keys about cache cleaning interval have a short time value (about 1 minute).

    I tried several options :

    • with local and remote MSDTC (remote with obviously the host machine of messages).
    • with the COM library mqoa.dll instead of .NET to use explicit MSDTC transactions for MSMQ.
    • with several different machines (all win7/2k8r2 sp1).

    There are no exceptions at the execution of my service, and all resources that I can close or/and dispose are closed/disposed as soon as possible. The memory allocation of my service is stable.

    In all cases, it's the same problem. How to solve it?

    Thanks in advance.


    Tuesday, June 14, 2011 8:46 AM


All replies

  • Hi Vincent,

    Recently Microsoft identified an issue where mqsvc.exe is leaking memory while doing remote transactional reads. Possibly this is the same issue that you are experiencing.

    Microsoft is currently working on this and fix for the same is expected somewhere in mid August.



    Note: please mark this as answered if this solved your query.

    Tuesday, August 02, 2011 1:07 PM
  • Hi Sudhir,

    First of all, thank you for the answer, although I found an alternative a few weeks ago.

    I have another problem I discovered yesterday, and like the previous problem, I didn't find anything about it.

    When an application use BeginPeek or BeginReceive on a private queue, and if the queue is deleted while the application waits for the event, the application crashes with an unhandled exception. There is no way to catch the exception and therefore no way to prevent the application from crash in this case. There is no problem with the public queues. No problem either with the library mqoa.dll, but in this case there is a limitation of 64 event registrations per application. In my case, 64 registrations is not enough, but even if I prefer use private queues, I can work with public queues.

    I will probably create a thread about this problem in the coming days.


    Thursday, August 11, 2011 8:42 AM
    • Marked as answer by Vincent Mahay Friday, August 12, 2011 10:09 AM
    Thursday, August 11, 2011 8:54 PM
  • Hi John,

    Thanks a lot for the link, it's a great blog about MSMQ you have.

    But there is no fix about my last problem.

    I just created a new thread about this problem


    Friday, August 12, 2011 10:09 AM
  • Yes, my post was to the main thread.



    Friday, August 12, 2011 11:53 AM