Search code examples
wcfc#-4.0msmqsvctraceviewer

What does 'Pool of native msmq messages is full' trace message mean?


I have been tracing messages using SvcTraceViewer.exe which were transmitted over MSMQ using a c# application, and have come across an informational event that I don't understand.

The raw XML looks like this:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
  <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
    <EventID>262242</EventID>
    <Type>3</Type>
    <SubType Name="Information">0</SubType>
    <Level>8</Level>
    <TimeCreated SystemTime="2015-03-02T14:54:57.3176368Z" />
    <Source Name="System.ServiceModel" />
    <Correlation ActivityID="{f6fa4c52-6372-45ce-9171-1c5d789c3bf0}" />
    <Execution ProcessName="MYPROCESS.EXE" ProcessID="12492" ThreadID="5" />
    <Channel />
    <Computer>MYCOMPUTER</Computer>
  </System>
  <ApplicationData>
    <TraceData>
     <DataItem>
        <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
          <TraceIdentifier>http://msdn.microsoft.com/en-GB/library/System.ServiceModel.Channels.MsmqPoolFull.aspx</TraceIdentifier>
          <Description>Pool of the native MSMQ messages is full. This may affect performance.</Description>
          <AppDomain>ASM.Sequoia.Reporting.ReportGenerator.exe</AppDomain>
        </TraceRecord>
      </DataItem>
    </TraceData>
  </ApplicationData>
</E2ETraceEvent>

The message 'Pool of the native MSMQ messages is full. This may affect performance.' is evident, but I can't find any meaningful information about what it might mean.

After a quick google, I have come across the following links - none of which really help me understand what this log is telling me, though the first one says that it can be ignored. As the blog is from 8 years ago, I thought I'd ask because I have no idea if the information is still up-to-date.

http://blogs.msdn.com/b/drnick/archive/2007/03/06/the-pool-is-full.aspx (says to ignore the info - but from 8 years ago)

https://msdn.microsoft.com/en-us/library/aa738731(v=vs.110).aspx (not very helpful MSDN post?!)

For info, I am using non-transactional queues, there are no queued messages (stuck in the queues or processing), nothing in the dead letter queues... The information I am sending over the queue is largish - can be up to a couple of MB in size as it contains a bunch of serialized images.

Does anyone know what this means?


Solution

  • I think that message is nothing to worry about. I took a look at WCF source code, and found it's just diagnostic message when some internal object pool is full. They use pool in order to reuse MsmqInputMessage objects. And when pool is full, they just leave that object to be garbage collected. It also seems they trace that same message when pool is empty, in which case they just create new object when that happens. So everything works correctly after these log messages, although a bit less optimally, i.e. some additional objects will be created and garbage collected.

    Btw. you can browse .Net source online or download it and open some of subprojects in VS. It's here:

    http://referencesource.microsoft.com/

    And here are some of interesting files for your issue: http://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Channels/MsmqInputMessagePool.cs http://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Channels/MsmqOutputChannel.cs

    You can search where MsmqDiagnostics.PoolFull method is invoked.