Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memory leak
Message
De
29/12/1999 16:55:40
 
 
À
29/12/1999 16:22:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00310104
Message ID:
00310117
Vues:
21
>Yesterday I posted the follwoing question.
>
>>Working on an application made up of many projects. Instead of each project having the same set of class libraries, the class libraries were broken out into its own project. When the application is started the following statement sets the classlib path:
>>
>>lcpath='C:\temp\'
>>lcClass='C:\temp\classlib'
>>lcclassname='INICLASS'
>>
>>SET CLASSLIB TO (lcpath+lcclassname) IN (lcClass) ADDITIVE
>>
>>
>>The only way the application works is if the exes are built into the final destination. If the exes are built to c:\temp\ then installed to d:\destination\ the application does not work. The error says it can not instantiate the class.
>
>The solution that ended up working was before compiling the .EXE, go through *.SCX and blank the classloc field. It works fine.
>
>However, there is a considerable memory leak while the applicaiton is running and it begins to crawl. The SYS(1016) value is continually increasing.
>
>The SET CLASSLIB statement has been changed to the following:
>
>SET CLASSLIB TO (lcpath+lcclassname) IN (lcClass) ALIAS lcClassAlias ADDITIVE
>
>In the unload of the form the statement
> RELEASE CLASSLIB ALIAS lcClassAlias is executed and it does remove it from the CLASSLIB list.
>
>It appears Foxpro thinks the CLASSLIB is released, but the memory is not released.
>
>Any insight as to why the SYS(1016) value increases and slows the application?

I don't know exactly why it slows things; I'd guess that it has to do with fragmented free or free-able blocks of memory managed by VFP. If garbage collection is forced, much if not all of the freed string space is recovered and can be reused. One technique to force garbage collection is to intentionally force an error to occur; be careful to disable error handlers immediately before and reestablish them immediately after this kind of forced garbage collection. Also, garbage colelction can be very time-consuming, since lots of things will be moved about...

Once VFP gets hold of memory, it doesn't like to give it back...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform