Just Let It Flow

October 3, 2009

Desktop Heap Monitor for Windows Vista, Server 2008 and 7

Filed under: Code, Windows — adeyblue @ 8:49 pm
    Contents

  1. Introduction
  2. Preparation
  3. Installation
  4. Usage
  5. Uninstallation

Introduction

For those who don’t know, Desktop Heap Monitor is a debugging tool that displays the consumption of desktop heaps in the current session. Due to its reliance on undocumented internal structures, the increase of the default size of interactive desktop heaps, or maybe just because it’s not an efficient use of time, Microsoft has so far decided not to release an update to the tool to allow it to work on operating systems released after Server 2003. So as I was doing some work in this area, I’ve created an update to let it do just that.

Preparation

Download the original version of Desktop Heap Monitor from Microsoft here and run the downloaded file to extract the files but don’t manually install it just yet.

Go to where the installer extracted the files to and open the appropriate folder for your architecture. Right-click the dheapinst.exe file, select the compatability tab and turn on compatability mode for Windows Server 2003 (Service Pack 1).

Download my update package and copy the extracted dheapdmp.sys for your architecture into the dheapmon NT52 directory. If you plan on using the package for Windows Server 2003 or Windows XP 64 also, then rename the original dheapdmp.sys before copying.

Move dheapinst.com from the driver package into the same directory as dheapinst.exe and fire up an elevated (Administrator) command prompt.

Installation

The actual installation instructions are exactly the same as they are in the accompanying help file, with one minor exception. Instead of invoking dheapinst.exe directly you must specify dheapinst.com or dheapinst only in order for correct initialization to take place.
The most common installation usage is like:

dheapinst -y srv*c:\symbols\*http://msdl.microsoft.com/download/symbols

See the help file in the dheapmon directory for more and alternate options, along with explanations. With that, setup is complete.

Usage

Before a report can be generated, run “dheapmon -l” to ensure the driver is loaded. After this has succeeded, “dheapmon” itself will generate a simple report and “dheapmon -v” will give a more in-depth report.

Some improvements have been made over the original version. The tool now gives reports on all desktops present on the computer regardless of session, rather than just the current session. As it is not uncommon for desktops in different sessions to be similarly named, the session that the desktop belongs to is appended to the name, producing output like the following:

Image of dheapdmp sample output

Image of dheapdmp sample output

The current session ID is given in the banner so you can easily see which desktops you are interacting with, rather than the ones used by services and other system components.

Uninstallation

Removal is achieved by running “dheapinst -r” from an elevated command prompt or by selecting the Desktop Heap Monitor entry from the “Add or Remove programs” control panel.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Hosted by 000Webhost.com