2

We have a situation where the ASP.NET worker process is using 100% of CPU intermittently. After analyzing the perfmon result and the memory dump, we saw an indication that the garbage collector is using the CPU time heavily.

Using WinDbg, we saw that the LOH is full of strings containing the full page of HTML pages. A !gcroot to the string often not finding any root. The question is whether this is normal on ASP.NET application or is this more specific to the way we build the web site?

It might be important to note that this ASP.NET website is a Sitecore based website. We understood that Sitecore cache the HTML output, but as far as my understanding, Sitecore doesn't cache the whole page, but only on rendering level.

chenz
  • 730
  • 7
  • 13

1 Answers1

1

Its is normal the full html page to be in memory because, and especial when the page buffer is on (and it is by default), the asp.net is build the page in memory, and after the page is fully render is send it to the browser.

Now in some cases I have see programmers that use the render function of the page, to grab that html and then search and replace some strings. So in this cases also the full html page can be found on memory.

Now, if you see your cpu to be 100% check if is followed by crash. If not then you probably have some heavy calculations there, or a lot of linq queries, or something similar.

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • Plus Sitecore caches the rendered html (I think to disk and memory), so that might also be what you are seeing. – Holger Feb 22 '13 at 09:36
  • @Aristos, The 100% cpu is not followed by crash, but just hang. When this happens, we saw a lot of threads is actually trying to allocate small chunk of memory but waiting for the garbage collection to complete. I went further to look whats actually on the heap and I found lots of large strings on the LOH. The full HTML page strings used up to 50% of the LOH size or about 70% of the total string instance in the LOH. That's why I'm asking if this is normal on a 'healthy' ASP.NET application. – chenz Feb 23 '13 at 09:37
  • @chenz Take a look at this answer: http://stackoverflow.com/questions/3044752/how-do-i-crash-the-app-pool/3045137#3045137 – Aristos Feb 23 '13 at 09:51
  • I think you misunderstood me, as I said in the question, the hang was not followed by a crash. – chenz Mar 14 '13 at 07:16