eG Monitoring
 

Measures reported by GdiViewTest

An object is a data structure that represents a system resource, such as a file, thread, or graphic image. An application cannot directly access object data or the system resource that an object represents. Instead, an application must obtain an object handle, which it can use to examine or modify the system resource. There are three categories of objects: user, GDI, and kernel. GDI objects support graphics. Here is a list of the GDI objects used in Windows:

  • Bitmap
  • Brush
  • Device Context (DC)
  • Enhanced Metafile
  • Enhanced-metafile DC
  • Font
  • Memory DC
  • Metafile
  • Metafile DC
  • Palette
  • Pen/extended pen
  • Region

GDI objects support only one handle per object, and only the process that created the object can use the object handle.

If an application creates a lot of these objects, without properly destroying references to the object (by closing the associated handle), then there will be multiple GDI objects occupying memory on the system for each object created. If this GDI leak is really bad, this can eventually bring a server to its knees, and cause all types of problems (slow logons, registry issues, system hangs, and so on).

If such fatalities are to be avoided, administrators should closely monitor the number of GDI object handles created by every user to the Microsoft RDS server and proactively detect potential GDI leaks. This is where the GdiViewTest test helps. This test periodically checks the GDI object handles created by each users to the Microsoft RDS server, reports the total number of handles created per user, and promptly notifies administrators if any user is creating more GDI handles than permitted. This way, the test brings probable GDI leaks to the attention of administrators. In addition, administrators can use the detailed diagnosis of the test to know which process is responsible for the GDI leak (if any). The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
Total_gdi_objects Indicates the total number of GDI handles that this user has created. Number The detailed diagnosis of this measure, if enabled, provides the process-wise breakup of the GDI handles created by the user. In the event of a GDI leak, this information will enable you to figure out which process initiated by the user spawned the maximum number of GDI handles, and is hence responsible for the GDI leak.
Percentage_of_gdiobj Indicates what percentage of the configured GDILIMIT is the total number of GDI object handles created by this user's processes. Percent This value is calculated using the following formula:

Total GDI objects/GDILimit * 100 A value close to 100% is a cause for concern, as it indicates that the count of GDI handles for the user is fast-approaching the permitted GDILIMIT. This hints at a potential GDI leak. You can then use the detailed diagnosis of the Total GDI objects measure to identify which process initiated by the user is spawning the maximum GDI handles and is hence contributing to the leak, and probe further.