Hope someone can help me make sense of this. I'm trying to debug some COM+ errors we see in our production environment and a few of them report that the desktop heap is exhausted, so I installed Windows Debugging Tools and DHeapmon for starters after reading the definitive Desktop Heap guide: http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx
Basically, as I understand it -- Every IIS worker process (w3wp.exe) should be allocated a (non-interactive) desktop heap; default of 512k. We have 30+ sites on our production box, and when I run DHeapmon to report the number of desktops, it not only doesn't report 30+ desktops as I expected (1 for each process, and then the actual windows interactive desktop on the server) -- it reports a single digit # of desktops.
I verified that we are not sharing application pools or desktops, so I should see a desktop for each process, right?
One thing I had a question about was -- if an IIS work process is IDLE, it should get killed -- default is 20 minutes I believe. However, I accessed one of the idle websites, it indeed spawned a new w3wp.exe for that site, then ran DHeapmon again, and it still reported the same number of desktops.
What am I missing? Is there a better way to get the info I'm after?
Any help is appreciated!
No, each session space has a single desktop. re-read the section of the link you have titled "Laying the groundwork: Session Space" from the article: "Session space is divided into four areas: session image space, session structure, session view space, and session paged pool ... Session view space contains mapped views for the session, including desktop heap"
To get additional desktop heap(s) you need to run seperate pools with seperate credentials. That being said running out of desktop heap on a server app tells me there is some bug in the code or just bad programming. Desktop heap is for UI elements. Another possibility is that IIS is running as the same user as an exisiting service account that has some bad code in it.
Lastly yes idle w3wp processes will get killed after the timeout but that will not necessarily spawn a new desktop as it depends on the user context creating it.