Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 9 Collections and memory leaks
Message
From
05/04/2017 09:54:47
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
05/04/2017 09:00:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01649799
Message ID:
01649802
Views:
86
>Hi you all,
>
>Just a quick question for those of you who have used and abused VFP end-of-life additions, VFP collections.
>
>Up to now, I resisted the urge to use VFP collections. They a bit clumsy as compared to the support for them in say python and a couple of other languages ones. But well I decided to use them for a relatively complex VFP task (with text and xml-via-com parsing).
>
>The good news: it worked and was reasonable simple. The bad one: memory leaks and COM -(and VFP-based) objects lost at runtime.
>
>I first had the initial bad reaction most have in front of mem leaks - nobody like these dangling references ! I then read a nice post by Rick Strahl on his great web site. Once i was back to life... I decided to replace a couple of collections with arrays. It worked wonderfully. The garbage collector would get back to work. Good news:)
>
>I still have numbers of VFP collections in this relatively complex pack of code. A few questions on VFP collection good practices:
>
>1) Would you recommend that I drop them all ? Or can we safely keep them for basic purposes such as collection of integers !
>2) Can you safely add and remove them dynamically with ADDOBJECT and REMOVEOBJECT and expect the garbage to be collected?
>
>Daniel

Would you be so kind and post the link to Ricks article?

I do not very much with collections in sense of deleting a lot of data. It's basically a fill and query job. I never run into an issue.

Coulkd you be more precise wath you do to create ther leakage?
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform