Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11099

Re: GDI usage going up on ApplciationExecs

From Arne Ortlinghaus <Arne.Ortlinghaus@acs.it>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: GDI usage going up on ApplciationExecs
Date 2017-10-27 17:05 +0200
Organization Aioe.org NNTP Server
Message-ID <osvhvs$1ch$1@gioia.aioe.org> (permalink)
References <osnf4k$q60$1@dont-email.me> <ospn18$v29$1@dont-email.me>

Show all headers | View raw


The bbrowser generates many GDI objects, that are not destroyed by the 
program, but are destroyed when they are removed by the Garbage 
Collector. I have inserted some code that checks the User and GDI 
objects regularly and calls the Garbage Collector explicitly if the 
number is near. This helped.

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


Check:
       if GetGuiResources(GetCurrentProcess(),GR_USEROBJECTS) > 
snMaxResourcesUserObjects
          CollectForced()
       endif
       if GetGuiResources(GetCurrentProcess(),GR_GDIOBJECTS) > 
snMaxResourcesGDIObjects
          CollectForced()
       endif


Arne Ortlinghaus


Martin wrote:
> Found that anything browse tends to take up GDI objects but does not
> always release, but closing the screen and rerunning uses the same
> objects again.
>
> So NOT a problem.
>
> Now the fun, we use a modified Willie Moores SLE classes including the
> date picker, and I have found it leaks one GDI object each time the
> calendar is popped up.
>
> Time to dig deeper!
>
> On 24/10/2017 14:27, Martin wrote:
>> Hello All
>>
>> I am going through a program which is left running over night and
>> occasionally runs out of GDI resources.
>>
>> I have fixed one 3 object leak as I forgot a ReleaseDC in two very
>> similar classes.
>>
>> During a load or a refresh I do call ApplicationExec to keep the
>> screen from freezing, but at one call I lose 1 GDI object and another
>> 9 GDI objects.
>>
>> I will experiment with removal, but any ideas why it would go up?
>>
>> Thanks
>>
>> Martin
>

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-24 14:27 +0100
  Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-24 16:56 +0100
    Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-24 17:00 +0100
      Re: GDI usage going up on ApplciationExecs Robert van der Hulst <rjvanderhulst@gmail.com> - 2017-10-24 23:58 -0700
        Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-31 12:00 +0000
      Re: GDI usage going up on ApplciationExecs "Karl-Heinz" <invalid@invalid.invalid> - 2017-10-25 12:21 +0200
        Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-31 11:58 +0000
      Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-25 09:19 +0100
  Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-25 10:54 +0100
    Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-25 12:00 +0100
    Re: GDI usage going up on ApplciationExecs Arne Ortlinghaus <Arne.Ortlinghaus@acs.it> - 2017-10-27 17:05 +0200
      Re: GDI usage going up on ApplciationExecs Martin <Martin@spam.spam> - 2017-10-31 11:57 +0000

csiph-web