Installing "Desktop Heap Information Monitor Tool v8.1:
To correctly install the
tool (
dheapdmp.zip), go to
AireSoft web page and follow the installation steps from the web. If an error pops up, follow the guidelines from the following links:
-
dheapInst - driver installation error occurred (2).
-
dheapinst - Driver Installation error occured (124).
If it helps, I got the error "
Driver Installation error occured (124)" and I fixed it by changing the compatibility of
dheapinst to
Windows Server 2003 SP1.
Once installed, if we run
dheapmon -l to install the monitor and then again
dheapmon, we will see the heap memory information:
More about "Desktop heap memory":
The Desktop Heap Monitor is a tool that examines usage of desktop heap.
WIN32 subsystem has internal heap area known as "desktop heap." When you run a large number of Windows-based programs, "Out Of Memory" error messages appear when you attempt to start new programs or try to use programs that are already running, even though you still have plenty of physical and pagefile memory available.
Increasing "Desktop heap memory":
To increase desktop heap memory, we can use the tool "
Microsoft Fix It 50496" that will increase the parameters automatically. If you want to fix it manually, you just need to go to the following registry path and tweak it:
- HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems
Where the default values for my windows vista are:
%SystemRoot%\system32\csrss.exe
ObjectDirectory=\Windows
SharedSection=1024,12288,512
Windows=On
SubSystemType=Windows
ServerDll=basesrv,1
ServerDll=winsrv:UserServerDllInitialization,3
ServerDll=winsrv:ConServerDllInitialization,2
ProfileControl=Off
MaxRequestThreads=16
The first SharedSection value (1024) defines the heap size common to all desktops. This includes the global handle table.
The second SharedSection value (12288) controls the size of the desktop heap that is associated with an interactive window station (used for Windows objects). This static value is used to prevent ill- behaved applications from consuming too many resources. Because the desktop heap is mapped into each process' address space, this value should not be set to an arbitrarily high value (as it would decrease performance), but should only be increased sufficiently to allow all the desired applications to run.
The third SharedSection value (512) controls the size of the desktop heap for each desktop that is associated with a "non-interactive" window station.
Monitoring Desktop Heap Memory:
As it is quite difficult to monitor, I have developed a little tool that you can download from
here, to log every change on the table result.
Just point the tool to the dheapmon executable and press start. Every 10s the output will be scanned and displayed into the component, taking into account the previous value, and if a change occurs it will be displayed in another colour.
Final notes:
Desktop Heap memory is related to "
Out of Memory" issues and this article will help you to work with this parameter and how to deal with it and monitor it.
Stay tuned for Part 2, where I will go further with Desktop heap memory using Delphi.
Jordi Corbilla.
Related links: