aca una info de el uso de esta función en vfp.
es bastante sabido que minimizando una app en windows, esta recupera memoria usada con anterioridad por la misma que no ha sido liberada.
esta función realiza esto mismo pero sin minimizar la app.
Hi Tom
Yes you are right, VFP memory usage will tend to increase as you issue SELECTS and VFP caches more stuff in memory. So say after a while the memory usage may even go up to 100 MByter or more. However if you minimize VFP you will find that it will dump the memory it has used up so far and drop down to about 2 MB. This means that minimizing VFP will force it to dump its cache and release the memory it was using so far to other apps.
There is a little known API that will do this for you without you having to do this minimizing or any sys commands. Try this in VFP.
Open the Task manager and check that the Mem Usage column is visible and highlight the VFP process. Note the memory used. Issue some big selects, open some forms for editing etc. Now run this code:
Declare Integer SetProcessWorkingSetSize In kernel32 As SetProcessWorkingSetSize ;
Integer hProcess , Integer dwMinimumWorkingSetSize , ;
Integer dwMaximumWorkingSetSize
Declare Integer GetCurrentProcess In kernel32 As GetCurrentProcess
nProc = GetCurrentProcess()
bb = SetProcessWorkingSetSize(nProc,-1,-1)
Now look at the Mem Usage for VFP in the Task Manager. It will fall to about 2 MB from whatever it was. This also works in compiled VFP EXE's as well.
Have fun.
Bernard