Click here to Skip to main content
15,905,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralResolution problem with my MFC - programms under Windows 2000 Pin
postamt26-Sep-03 1:11
postamt26-Sep-03 1:11 
GeneralKill a Process Pin
cberam26-Sep-03 1:04
cberam26-Sep-03 1:04 
GeneralRe: Kill a Process Pin
David Crow26-Sep-03 3:00
David Crow26-Sep-03 3:00 
GeneralCreating a CWnd with a dialog resource Pin
Antti Keskinen26-Sep-03 0:52
Antti Keskinen26-Sep-03 0:52 
GeneralRe: Creating a CWnd with a dialog resource Pin
KarstenK26-Sep-03 1:33
mveKarstenK26-Sep-03 1:33 
GeneralRe: Creating a CWnd with a dialog resource Pin
Antti Keskinen26-Sep-03 4:15
Antti Keskinen26-Sep-03 4:15 
QuestionRan out of... ...something? Pin
-Dy26-Sep-03 0:48
-Dy26-Sep-03 0:48 
AnswerSystem limits (LARGE post). Pin
73Zeppelin26-Sep-03 5:31
73Zeppelin26-Sep-03 5:31 
User Object Handles

User objects are one of three categories of objects handled by the Windows NT® and 2000 operating systems. User objects include items such windows, menus, cursors and icons. The other two categories, GDI and kernel objects, are discussed in subsequent sections.

There is a system wide limit of 65,536 user handles per system. According to Microsoft, there is no per-process limit2; however, testing yielded the following results on Windows NT 4.0 SP6a and Windows 2000 SP2:


Operating System Default Limit Maximum
Windows NT No default No per-process maximum
Windows 2000 10000 (0x2710) 10000 (0x2710)


On Windows NT, although it appears that the per-process maximum is theoretically the same the system maximum of 65,536, the actual maximum is dependent on the type of user objects as well as other system resources such as desktop heap (which is discussed later). On Windows 2000, the maximum number of user handles per process can be set in the following registry entry; however, the default value of 10000 (0x2710) seems to also be the maximum value.

HKLM/Software/Microsoft/Windows NT/CurrentVersion/Windows/USERProcessHandleQuota

In Windows 2000, user object handle counts can be monitored via the Processes tab of Task Manager by selecting View->Select Columns... and selecting the "USER object" check box. While this option also exists in Task Manager on Windows NT, it is not functional on that platform.

GDI Object Handles

The Graphics Device Interface is the means by which applications communicate with graphical devices (such as monitors and printers) in a device-independent fashion. GDI objects include pens, brushes, bitmaps, fonts, etc. The per-process defaults and limits for the number of these objects varies between the NT and Windows 2000 operating systems. Additionally, the registry entry where the per-process limit can be set varies slightly; however, that key is found in the HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Windows hive in both operating systems. Details on GDI limits and the registry entry name are provided in the table below.


Operating System Default Limit Maximum† Registry entry (DWORD)
Windows NT 12288 (0x3000) 16384 (0x4000) ProcessHandleQuota
Windows 2000 10000 (0x2710) 16384 (0x4000) GDIProcessHandleQuota


† Although this is a documented maximum, systems become fairly unstable
after about 15000 GDI handles have been allocated.

Like user object handles, GDI handles can be monitored on Windows 2000 via Task Manager. On Windows NT, GDI handle monitoring within Task Manager is unavailable, so some alternative tool, such as ResourceMonitor, is needed to monitor this resource

The final category of Windows objects is kernel objects, which include system level entities like processes, threads, events, mutexes and files. Each process has a limit of 230 (1073741824) kernel objects.

When a client makes a request to a server, a thread is created for that client, and that thread is generally used to execute the client request. The number of simultaneous client requests therefore has an upper bound equal to the number of threads that can be created within a process.

The number of threads a process can create is also limited by the available virtual memory. By default, when a thread is created, it is assigned one megabyte of stack space, therefore, a process can create at most 2028 threads. Thread stack size can be modified using the EDITBIN utility provided with Microsoft Visual Studio.


Desktop Heap

Desktop heap is a memory resource used to store data relating to graphical objects (such as windows and menus) created within an application. Any executable or library that is statically or dynamically linked with USER32.DLL may make use of desktop heap. Due to the interrelationship of user and GDI objects with the desktop heap, limited heap resources can reduce the effective limits on the per-process maximum numbers of user and GDI objects mentioned earlier in this document.

A desktop heap is allocated for each desktop associated with a window station. Each window station contains a default desktop and other optional desktops that might be created programmatically. In turn, each desktop can contain one or more windows. There is exactly one interactive window station (WinSta0) which is created automatically by winlogon.exe process and includes three desktops: the application (default) desktop, the Winlogon desktop and the screen-saver desktop.
Programs defined as services are also associated with window stations. There are three different options for running services, and each of these options results in a different association with a window station.

The combined size of all desktop heaps has an upper limit of 48MB on Windows NT and 2000. If Terminal Server is executing, the 48MB limit is reduced to 22MB. (On Windows XP the desktop heap is configurable to nearly 500MB). The amount of desktop heap assigned to the interactive window station and to window stations associated with services can be configured via a registry setting. The setting resides in the string value at

HKLM/SYSTEM/CurrentControlSet/Control/Session Manager/SubSystems/Windows

The value is a string that contains the following sequence SharedSection=1024,3072,512 (or perhaps, SharedSection=1024,3072, where the third value is not specified). The first parameter specifies the size of the heap common to all desktops. The second parameter is the size of the default heap for the application desktop (namely, the default desktop in WinSta0). The final parameter specifies the default heap size for desktops created as part of window stations associated with non-interactive services. If this parameter is not specified, all non-interactive services will share the same 3MB heap as the application desktop. If the third value is given, each non-interactive service will be assigned a desktop heap of the specified size. The minimum size for this parameter is 128KB. There is no specific maximum; however, given that the available combined desktop heap allocation can not exceed 48MB, the larger this value the fewer the number of non-interactive services that can be supported.


Big, I know, but there's quite abit of info in there.





John Theal
Physicist/Mathematical Programmer
Digital Immersion Software Corporation

Got CAD?
http://www.presenter3d.com[^]
http://www.merlin3d.com[^]
GeneralRe: System limits (LARGE post). Pin
-Dy26-Sep-03 5:42
-Dy26-Sep-03 5:42 
GeneralCEdit and multiline. Pin
esepich26-Sep-03 0:30
esepich26-Sep-03 0:30 
GeneralRe: CEdit and multiline. Pin
David Crow26-Sep-03 3:03
David Crow26-Sep-03 3:03 
GeneralRefresh API Pin
rohit.dhamija25-Sep-03 23:43
rohit.dhamija25-Sep-03 23:43 
GeneralPLEASE help experts.... Pin
rohit.dhamija26-Sep-03 1:42
rohit.dhamija26-Sep-03 1:42 
GeneralRe: Refresh API Pin
David Crow26-Sep-03 3:05
David Crow26-Sep-03 3:05 
GeneralRe: Refresh API Pin
rohit.dhamija26-Sep-03 4:00
rohit.dhamija26-Sep-03 4:00 
GeneralRe: Refresh API Pin
David Crow26-Sep-03 5:57
David Crow26-Sep-03 5:57 
GeneralRe: Refresh API Pin
rohit.dhamija26-Sep-03 19:33
rohit.dhamija26-Sep-03 19:33 
GeneralRe: Refresh API Pin
AORD27-Sep-03 17:27
AORD27-Sep-03 17:27 
GeneralRe: Refresh API Pin
rohit.dhamija28-Sep-03 18:01
rohit.dhamija28-Sep-03 18:01 
GeneralRe: Refresh API Pin
AORD30-Sep-03 22:38
AORD30-Sep-03 22:38 
GeneralRe: Refresh API Pin
rohit.dhamija30-Sep-03 23:45
rohit.dhamija30-Sep-03 23:45 
GeneralMicrosoft C++ Exception at kernel32.dll Pin
Neha25-Sep-03 22:20
Neha25-Sep-03 22:20 
GeneralRe: Microsoft C++ Exception at kernel32.dll Pin
vcplusplus26-Sep-03 1:23
vcplusplus26-Sep-03 1:23 
GeneralRe: Microsoft C++ Exception at kernel32.dll Pin
Neha26-Sep-03 1:28
Neha26-Sep-03 1:28 
GeneralRe: Microsoft C++ Exception at kernel32.dll Pin
vcplusplus26-Sep-03 1:39
vcplusplus26-Sep-03 1:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.