I have built a suite of internal websites for our company to manage some of our processes. I have been noticing that these pages have massive memory leaks that cause the pages to be using well over 150mb of memory, which is ridiculous for a webpage that consists of a single form and a GridView that is displaying 7-10 rows of data at a time, sometimes with the data not changing for a whole day. This is an issue because it is slowing down our client machines due to lack of available memory.
After some testing it appears that the memory leak is extremely easy to reproduce, and very noticeable. I created a page with the following asp.net markup:
<body>
<form id="form1" runat="server">
<div>
<asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
<asp:Timer ID="timer1" runat="server" Interval="1000" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
There is absolutely no code behind for this. This is the entirety of the page. Running this site in Chrome shows the memory usage shoot up to 25 megs in the span of 20-30 seconds. Leaving it running for a few minutes makes the memory go up to the 70 megs and such.
Am I using timers and update panels wrong, or is this a pure Asp.net issue with no work around?
Note: I am not talking about memory used on the server, I am talking about memory used on the client.
Edit: Well it looks like this is an issue with Chrome. Firefox and IE8 do not seem to have any memory issues while running this page for a long period of time.
.NET isn't necessarily using all that memory. See How can I determine how much memory my .NET program is using?
I read a really good article about it once but I can't find it now. I'll update this answer if I do.
Edit: Here's a good one: Link And one more: http://www.getdotnetcode.com/gdncstore/free/Articles/The%20Memory%20Mystery.htm
I know it have been a while since the last answer, but maybe my answer will help some one. I had similar problem. I needed timer working on background.I ended up with Update panel with the timer causing memory leak. My timer was inside the update panel. Making Update panel invisible with Visible:=False
solved the problem. It looks like page was redrawn every second causing major memory use buildup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With