Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory leaks?
Message
From
28/10/1998 22:01:06
 
 
To
20/10/1998 08:44:12
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00148261
Message ID:
00152070
Views:
22
Rick,

In the instance you cite below it may simply be that you are checking too quickly - I wouldn't be surtprised if VFP only does actual cleanup on an intermittent basis.

But as for your real problem, are you quite certain that you don't have *any* "dangling references" to the object???
In case you are unfamiliar with the term, it basically means some memvar containing the object's reference which has *NOT BEEN SET TO NULL* before the RELEASE (or Destroy). That will definitely cause a memory leak in you situation (though some would reject that terminology, reserving it for leaks which generally affect the whole machine).

Good Luck,

Jim N

>>>Has anyone noticed that there is no way of totally freeing up memory after instantiating a class then removing it? I have a system which receives data over a telephone network. In a "good" day I may receive over 10000 events. In the 'old' days (FP2.x) I would use numerous memvars and save events to files. Now I instantiate an object and populate properties of the object before storing interpreted results. Problem is every time I CREATEOBJECT() or AddObject() I loose memory according to SYS(1016). Soon my app slows to a crawl. I am, BTW removing the object RemoveObject() or releasing the reference to it.
>>>
>>>The only way I have been able to get around this is to create the needed objects at the outset of the app and simply reuse them every time I get a new message.
>>>
>>>Is this correct? Even from the command window if you CREATEOBJECT() and then release the reference, you can see memory creeping away. The only way to get it back is with a CLEAR ALL.
>>>
>>>Any thoughts?
>>>
>>>Rick Grinter
>>
>>
>>Have you tried RELEASE MyClassInstance?
>Craig:
>
>Thanks for the response. I have not only tried RELEASE but when my objects are contained by another I have tried RemoveObject. Try the following from the command window:
>
>SET CLASSLIB TO MyClassLib
>? SYS(1016)
>MyClassInstance = CREATEOBJECT('MyClassDef')
>? SYS(1016)
>RELEASE MyClassInstance
>? SYS(1016)
>
>The results I just now got to the SYS(1016) query were:
>
>334820
>346244
>344988
>
>and this from the command window. When I took my application and commented out all but the creation and release of the objects and printed the SYS(1016) to the screen after each pass, my memory useage continued to creep up in approximately 12000 byte increments.
>
>Rick Grinter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform