>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
Sleep(1000)
HTH