I have two windows services that use NserviceBus. One writes messages to the queue, while the other reads them and does some processing. All queues are transactional, and the NserviceBus endpoints are configured as follows.
.IsTransactional(true) .IsolationLevel(IsolationLevel.ReadCommitted) .MsmqTransport() .RunTimeoutManager() .UseInMemoryTimeoutPersister() .MsmqSubscriptionStorage() .DisableRavenInstall() .JsonSerializer()
The problem is that a large number of messages (170,000+) are queued, the MSMQ service (mqsvc.exe) is playing out quite a bit of memory (1.5 - 2.0 GB), and this memory is not freed up for at least 5 - 6 o'clock. The average message size is about 5 - 10 KB. And it looks like the more messages you queue the more memory it uses. The memory consumption of Windows Services based on NServiceBus is within acceptable limits (50 - 100 MB) and does not increase no matter how many messages they process.
Any ideas on why MSMQ will use this large memory and take it long enough? Thanks heaps.
source share