Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory leak
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Memory leak
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01095329
Message ID:
01095329
Views:
67
Folks

I'm running an app that creates pages of HTML using Office automation (graphic objects created on an Excel worksheet and saved in web format). This iterates to create an entire website and takes about 2 hours to run, in the form:
SELECT TheCursorWithTheDataInIt
SCAN
  oXLPage = CREATEOBJECT("DoOnePageThingy", param1, param2 ...)
ENDSCAN
Only trouble is, there's a memory leak somewhere. I start with a memory usage of about 350Mb on my 1Gb system and by about 1/3 of the way through memory usage has risen to >1.5Gb and my system grinds to a halt. When I close Excel manually, memory usage drops just for the Excel instance. When I close VFP9, I recover >1Gb of memory, so I'm pointing at the VFP part of my app.

I assume the object oXLPage above should be garbage collected on each iteration, but to be more explicit I have tried this form:
SELECT TheCursorWithTheDataInIt
SCAN
  = Do1Page(param1, param2 ...)
ENDSCAN

PROC Do1Page
LPARAMETERS param1, param2 ...
* the var goes out of scope more explicitly here
LOCAL oXLPage
oXLPage = CREATEOBJECT("DoOnePageThingy", param1, param2 ...)
ENDPROC
However, no improvement. Any clues that may relate to var scope, Autoyield, DOEVENTS etc?

John Burton
Next
Reply
Map
View

Click here to load this message in the networking platform