473,714 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#: resource leaks using System.Messagin g (MSMQ) from an ASP.NET application

1 New Member
We are seeing some kind of resource leak in our performance lab running an ASP.NET (2.0) application that sends and receives messages from 2 public MSMQ queues. Here's a brief summary of what are application does:

1. user provides input on a form on an aspx page and clicks continues
2. on postback, the page creates a c# .net object and calls a method on it to process the data provided by the user
3. the object in turns creates an MessageQueue object and uses it to send a message to an MSMQ queue. It then creates another MessageQueue object to receive a response message from a different queue. our object does not use events or callbacks. It calls ReceiveByCorrel ationId to get its message back.
4. our code calls close and dispose on all queues and messages as soon as they are not needed anymore.
5. because of legacy code and need for backwards compatibility, we use the activeX formatter for the outgoing and incoming MSMQ message.

about our setup:
* our app runs on a win2k advanced server.
* the queues are on a separate server also running win2k
* the DC is yet on another server also running win2k
* all servers are on the same LAN and run MSMQ 2.0

When we run our application in our performance lab using a stress test tool, we are seeing the following behavior:
1. everything runs fine and fast until about 30 to 40 minutes into the test (9 minutes into the test, all test users are fully in the test executing all steps of the test script ). Then we see a huge slow down in response times and after a while aspnet_exe restarts. from that point on, the app never truly recovers and runs slow.
2. we have run TMQ STATE at various times during the test and see a constant increase in the number of handles and threads during the test. For example, TMQ state reports that at 15 minutes into the test, the number of threads is 49 and the number of handles is 383. At 41 minutes into the test the number of threads is 68 and the number of handles is 560.
3. we run only 40 test users during the test so at most there are only 40 concurrent calls happening to MSMQ.
4. The Pool Paged Bytes memory perf counter is creeping up during the test but only from 40 MB to 45 MB or so.
5. There are no MSMQ errors in the event log
6. after the problem occurs, our app logs a number of MSMQ timeout errors indicating that it did not get a response message within a given amount of time (set at 100 seconds for this test)
7. if we run a similar script that does not make calls to MSMQ, we do not see this problem.
8. we turned MSMQ logging on and see many errors/events being recorded in the log during the test

These numbers seems to indicate to me that we are (1) leaking some resource related to MSMQ and (2) that we hit a threshold for this resource 30 to 35 minutes into the test.

We have captured a bunch of other counters and data that we can share if this would help. Note that we have read all MSDN and forum posts related to MSMQ and resources, but none are helping (our messages our way less than 4 MB in size, we don't use callbacks, we don't get a "insufficie nt resources" error, etc.)

Does anyone have experienced similar issue? Also, does anyone know how to interpret TMQ State data (what are the "number of threads" and "number of handles" data for example) and MSMQ logs?

any help would be greatly appreciated.

~
Nov 26 '07 #1
1 4769
kenobewan
4,871 Recognized Expert Specialist
Here is an article that may help:
MSMQ from the plumber's mate
Nov 27 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1867
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have used .Net memory profiler from Sci Tech to analyze the leaks and they are coming from inside HttpWebRequest and HttpRebResponse. When I run my code on VS2005, I do not get any leaks. Is this problem fixed in .Net 1.1 SP1? I may not be able to wait...
10
2341
by: Niall | last post by:
I'm not quite sure which groups to post this to, so short of a massive crosspost, I decided on these two. I am running into troubles with resource usage of our app on Win2k and above systems. In several places, I have seen it said that the WinNT model only limits resources to available memory. However, I have seen errors caused by running out of resources on a machine with over 1GB of free memory (running Win2k server), as well as on my...
3
2085
by: S.Creek | last post by:
Hi, I am trying to build a multi clients application with C# that will send and receive messages using a listener on a server, the computers are all on the same LAN, the listener need to identify a message in the MS Queues he listens on, and send it to the relevant clients (not all need to get all messages) it can send the message through an event or an interface.?
1
2121
by: John A Grandy | last post by:
in .NET 2.0 where is the type Message located ? in .NET 1.1 it was System.Messaging.Message
14
15873
by: Webbee | last post by:
I have a service built that is trying to read messages from a private que. When this tries to happen I get this error.... A workgroup installation computer does not support the operation From what I read I need to have my system setup on a domain, is this correct? For my dev work I'm not going to have that envirorment available and everything is tested on one laptop. Is there anything I can do? Thank you
1
2019
by: Anthony J. Biondo Jr. | last post by:
Hi Everyone: I was wondering if it is common practice to use some sort of messaging (MSMQ, WebSphere MQ) with web services. I understand the need for messaging for insert / update transactions, but do you think using messaging for inquiry transactions is overkill? thanks, Anthony
5
2776
by: Daniel | last post by:
Hey guys When you hook an event (c# 2.0 syntax): myEvent += MyMethodToFire; You need to also unsubscribe it to avoid a resource leak so that the object it is in gets garbage collected like so : myEvent -= MyMethodToFire; That's all fine, but when you use visual studio to create events for objects it never creates an unsubscribing reference, so is it puting in resource leaks? Or is this being cleared somewhere that i am not seeing?
0
1687
by: dom_perron | last post by:
Hi, I have a problem when I try to start an application using MSMQ from a Windows Service. The application runs on a server. The client send a message to a public queue created on the server, the server process the request and return the result to a public queue on the client. All is working fine if I start my application directly on the server. But we want to embed the start of the application into a Windows service. When I install...
0
2118
by: ASPnewb1 | last post by:
Hello, I have a question about MSMQ as I'm new to using this system in the .NET framework. Here is my following application that I run 2 instances of to test the ability to communicate through the MSMQ. It's just a basic form with 2 textboxes, and 2 buttons, first textbox is to "send" or put on the queue (with a send button), second is to receive (take from the queue with a receive button). My question is, why before I specified...
0
9314
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...
1
9075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9017
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
6634
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
5948
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
4464
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
4726
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3158
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
2
2522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.