Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are Windows "USER objects"

I'm trying to track down an issue in our MFC code that looks like a resource limitation issue. Memory and CPU look fine. According to the processes tab on the Task manager our GDI objects look in line with other applications, but our USER objects appear to be a factor of 10 greater then other applications.

What is a "USER object" and what are the limits?

like image 764
JonDrnek Avatar asked May 15 '09 12:05

JonDrnek


People also ask

What is a user object?

A user object is a security principal, which means that it would have a security identifier (SID) apart from a global unique identifier (GUID). A user object in AD has attributes that contain information such as canonical name.

What are objects in Windows?

An object is a data structure that represents a system resource, such as a file, thread, or graphic image. Your application can't directly access object data, nor the system resource that an object represents.

How many objects are there in Windows OS?

Windows has more than 25 types of objects. A few of the types are: Files. Devices.

How do you create a user object?

To create a new user objectOpen the New dialog box. On PB Object tab page, select the kind of user object you want to create. The five user object choices display at the top of the tab page: Click OK.


2 Answers

Here is a "classic" MSDN article: Give Me a Handle, and I'll Show You an Object

Last time I was tracking down Windows object leaks (which i suspect you have) Process Explorer was handy (handley?). The lower-pane could show some allocated system objects, plus it could do the simple USER, GDI, etc object counting.

The desktop heap, which is a pool of memory where the real "stuff" the handle represents lives (at least some handles, not kernel handles at least). It's sometimes not so much how many handles you have allocated but how much memory each object under that handle is using. You can debug the heap this way. It is a pain to install.

like image 112
Aardvark Avatar answered Sep 23 '22 01:09

Aardvark


Read all about it here:

Object Categories

The system provides three categories of objects: user, graphics device interface (GDI), and kernel. The system uses user objects to support window management, GDI objects to support graphics, and kernel objects to support memory management, process execution, and interprocess communications (IPC). For information about creating and using a specific object, refer to the associated overview.

and here:

User Objects

User interface objects support only one handle per object. Processes cannot inherit or duplicate handles to user objects. Processes in one session cannot reference a user handle in another session.

There is a theoretical limit of 65,536 user handles per session. However, the maximum number of user handles that can be opened per session is usually lower, since it is affected by available memory. There is also a default per-process limit of user handles. To change this limit, set the following registry value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\USERProcessHandleQuota

This value can be set to a number between 200 and 18,000.

like image 22
Otávio Décio Avatar answered Sep 25 '22 01:09

Otávio Décio