0

I am working on an ASP.NET page using C#. I have a label that I am outputting a large string to. Then I am clearing the label and outputting a large string to it again. I have been monitoring the memory usage of my browser, Chrome/IE, and have noticed that the memory keeps going up, even after I clear my label. It is important to note that I am using AJAX for this label so that the button only updates the label not the entire page.

For instance it starts using about 25mb. Then after I output a large string to the label it jumps to about 27mb. Then I clear the label, and it still sits around 27mb. Then if I repeat this process the memory usage keeps jumping by about 2mb/click.

Is this an obvious sign of a memory leak or does this have to do with the AJAX?

Any thoughts/links provided are appreciated!

4
  • 1
    How much memory your browser is using has nothing to do with what language or technology your using on the server. If anything, this is a javascript problem and not a asp.net or c# problem. Commented Jan 4, 2011 at 0:59
  • Can you share the AJAX and HTML code relevant to this? Memory leaks are possible, google "javascript memory leaks" for example. But we can't tell if it's one if we don't know what your code does exactly... Commented Jan 4, 2011 at 1:01
  • @MystereMan Retagged, can't change the title though... Commented Jan 4, 2011 at 1:02
  • 1
    @TomWij - Good idea. I left asp.net in because it may be related to the asp.net ajax generated. Commented Jan 4, 2011 at 1:06

2 Answers 2

1

Thanks for the feedback everyone it was extremely helpful! I did narrow this down to a client side javascript error that is caused by using ASP.NET Validators inside of an ajaxified panel. The ASP.NET validators re-register every time they are updated within a panel giving weird results such as a validation summary displaying the same error message multiple times. This also caused my memory leak because the way that the validators are registered, with javascript.

More information on the validation errors can be found here http://jatindersingh.blogspot.com/2009/03/validationsummary-displayed-multiple.html

Sign up to request clarification or add additional context in comments.

Comments

0

Are there any other elements in the page which reference any of the large strings after you clear the label? If so, that may be a reason why the memory is growing like it does.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.