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

Path csiph.com!news.swapon.de!aioe.org!.POSTED!not-for-mail
From Arne Ortlinghaus <Arne.Ortlinghaus@acs.it>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: GDI usage going up on ApplciationExecs
Date Fri, 27 Oct 2017 17:05:33 +0200
Organization Aioe.org NNTP Server
Lines 71
Message-ID <osvhvs$1ch$1@gioia.aioe.org> (permalink)
References <osnf4k$q60$1@dont-email.me> <ospn18$v29$1@dont-email.me>
NNTP-Posting-Host fyOKCP3+kSV+xniBkgRj5A.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.clipper.visual-objects:11099

Show key headers only | 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