Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Timer Memory Problem
Message
From
02/08/2006 09:49:26
 
 
To
02/08/2006 09:40:42
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01142378
Message ID:
01142384
Views:
10
>Our product is a 24/7 Hospital product and i face a critical issue in Timer control.
>
>The below code is a small example of my process, i created an exe of this code and this runs as a process in the task manager. The issue is this eats up memory consistently in time intervals.
>
>if this exe is ran for days the memory is used is like in MBs and slowing down the PC's performance.
>
>[SNIP]
>
>I tried using the memory allocation command in the Timer Event to limit to 6800 KB but it didnt work.
>
>= sys(3050, 2, 6800 * 1024)
>
>My scenario is like this we have some files in a folder from another application which i have to access constantly in a time interval of one second and read the files separate the tokens and put in my Applications DBF.
>
>do we have any other way we can do this in VFP.
>
>i tried with DO While .t. Loop but its eating up the processor time upto 50% which is too costly for our customer.
>
>Please suggest me some solution where i can limit the memory usage.



I responded to your same message in the MSDN board:

The timer routine is not the one eating memory. You must have some memory sink somewhere in your program. Probably you are instantiating an object or three that you are not clearing. Make sure you do some garbage collection by releasing all objects and to make extra sure make the variable that holds the object reference = null

See also: http://fox.wikis.com/wc.dll?Wiki~OOP,GarbagecollectionAndDanglingObjectReferences...


As per the Timer routine, if you want you can replace it with the Sleep API:
DECLARE Sleep IN kernel32 INTEGER dwMilliseconds 
* then when you need to wait a second:
Sleep(1000)
HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform