A possibility to control is the number of User and GDI objects opened. I
inserted a procedure that calls the Garbage collector automatically if the
number is exceeding a limit.
-- Regular control
if GetGuiResources(GetCurrentProcess(),GR_USEROBJECTS) >
snMaxResourcesUserObjects
CollectForced()
endif
if GetGuiResources(GetCurrentProcess(),GR_GDIOBJECTS) >
snMaxResourcesGDIObjects
CollectForced()
endif
-- Initialization
snMaxResourcesUserObjects := ;
QueryRegInt (HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Windows", "USERProcessHandleQuota", 0)
snMaxResourcesGDIObjects :=;
QueryRegInt (HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Windows", "GDIProcessHandleQuota", 0)
if snMaxResourcesUserObjects == 0
snMaxResourcesUserObjects:= 10000
endif
snMaxResourcesUserObjects := snMaxResourcesUserObjects*8 / 10
if snMaxResourcesGDIObjects = 0
snMaxResourcesGDIObjects := 10000
endif
snMaxResourcesGDIObjects := snMaxResourcesGDIObjects*8 / 10
Arne Ortlinghaus
ACS Data Systems
"Martin" <sp...@spam.spam> schrieb im Newsbeitrag
news:iXHur.924614$Pq.7...@fx09.am4...