2

I'm looking for a tool to track GDI usage so I can get alerts when it gets close to the max. This is on Windows XP SP3.

As background, here are some related pages/apps that don't quite fit the bill:

There is a thread on this at http://forum.sysinternals.com/topic13580.html, but no real answer.

bear which is mentioned in the above article does do totals, but it it GUI based and more importantly is seems to use a lot of CPU.

Usage Monitor looks promising on the surface, but only sets limits on individual processes rather than the total.

These don't have have GDI totals:
* Process Explorer
* System Explorer

These do not have GDI:
* PsTools
* Process Viewer
* tasklist
* Task Manager

2 Answers 2

4

There is a GUI/command-line tool called GDIView. The tool can dump to a text file or CSV. It has per process stats so you'd have to process the output (powershell could handle this) then alert if the total exceeds your limits.

2
  • 1
    Nice, that is actually one I had tried (actually still on my machine :), but hadn't realized it had a command line option when I skimmed the docs. I should have realized the "save the text file" option implied not running the GUI. Thanks! Got to love nirsoft, that guys has built a lot of useful, free stuff.
    – studgeek
    Aug 31, 2011 at 18:15
  • 1
    For those who are interested I am using it with Cygwin as follows to get my total GDI: GDIView.exe /stab gdiview.txt && awk '{ SUM += $3} END { print SUM }' < gdiview.txt and if you want to check it every 30seconds: for (( ; ; )) do /c/apps/gdiview/GDIView.exe /stab gdiview.txt && awk '{ SUM += $3} END { print SUM }' < gdiview.txt; sleep 30; done
    – studgeek
    Aug 31, 2011 at 18:26
3

Please see @uSlackr's answer for the correct answer GDIView and its link. I'm adding a 2nd answer to share the Cygwin bash script I wrote around it to track totals and raise alerts when it goes over a certain amount in case it's helpful for others.
This script echoes the time and GDI total every INTERNAL (default 120) seconds. If the GDI total is over GDILIMIT (default 10000) it raises a message box and also echoes the top 15 GDI users so you can see who is hogging. Thanks @uSlackr!

#! /bin/bash

INTERVAL=120
GDILIMIT=10000

for (( ; ; ))
do
/c/apps/gdiview/GDIView.exe /stab `cygpath -w $TMP/gdiview.txt`
gdi=`awk '{ SUM += $3} END { print SUM }' < $TMP/gdiview.txt`
echo -e `date +%H:%M` $gdi "\033]2;$(basename $0) $gdi\007"
if [ "$gdi" -gt "$GDILIMIT" ] 
then
  head -15 $TMP/gdiview.txt
  msg $USER "GDI is $gdi"
fi
sleep $INTERVAL
done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .