Why do Asp.net/ update timers accumulate in Chrome and can they be fixed / processed?

I created a set of internal websites for our company to manage some of our processes. I noticed that these pages have massive memory leaks that force pages to use more than 150 mb of memory, which is ridiculous for a web page consisting of one form and a GridView that displays 7-10 lines of data for a while, sometimes with data that does not change for all day. This is a problem because it slows down our client machines due to lack of available memory.

After some testing, it turns out that the memory leak is extremely easy to play 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 no code for this. This is the whole page. The launch of this site in Chrome shows that memory usage increases to 25 megabytes in the interval of 20-30 seconds. Leaving it to work for several minutes, the memory increases to 70 megabytes, etc.

Am I using timers and update panels incorrectly, or is it a pure Asp.net problem without any work?

Note. I'm not talking about the memory used on the server, I'm talking about the memory used on the client.


Edit: Well, it looks like this is a problem with Chrome. Firefox and IE8 do not seem to have memory problems with this page for a long period of time.

+4
source share
2 answers

.NET does not necessarily use all this memory. See How do I determine how much memory my .NET program is using?

I read a really good article about this once, but I can’t find it now. I will update this answer if yes.

Edit: Here's a good one: http://blogs.msdn.com/b/tess/archive/2006/09/06/742568.aspx And another one: http://www.getdotnetcode.com/gdncstore/free/Articles/ The% 20Memory% 20Mystery.htm

+2
source

I know that some time has passed since the last answer, but maybe my answer will help someone. I had a similar problem. I need a timer running on background. I ended up updating the panel with a timer causing a memory leak. My timer was inside the update panel. Creating an update panel invisible with Visible:=False solved the problem. It seems that the page was redrawn every second, causing a significant increase in memory.

0
source

Source: https://habr.com/ru/post/1312976/


All Articles