Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limiting a VFP app usable memory
Message
From
29/01/2004 07:34:08
 
 
To
29/01/2004 06:58:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00871717
Message ID:
00871727
Views:
20
Hi Thomas, thanks for replying!

Very good tip, in KB article 831905 I could read:

"To free up the working set, a program can call the SetProcessWorkingSetSize function with both the minimum and the maximum size set to 0xffffffff. A program can also call the SetProcessWorkingSetSize function when the program will be idle for a long time or after the program completes an expensive task that has a big working set."

Also the option of minimizing the app produced drastic reductions of memory usage.

Now I'll make some tests with the code you gave me.

Just a question: when should I use SYS(3050) and SetProcessWorkingSetSize()? Is SYS(1104) another issue to be considered?

Regards,

Fernando

>>Hi,
>>
>>I'm wanting to limit the total memory used by a VFP app to a certain amount, let's say 64Mb.
>That might be quite detrimental to perf.
>At LEAST do it in a way depending on the actual
>installed RAM and the curent memory situation.
>
>>Now the question: there is a way to effectively limit the total amount of memory used?
>As I could understand SYS(3050) won't do it.
>
>SYS 3050 works splendid for selects and so on.
>
>If you are NT-based, you can trim back the memory
>(minimize the apps window) or call
DECLARE INTEGER GetCurrentProcess IN kernel32
Declare INTEGER SetProcessWorkingSetSize IN kernel32  ;
   INTEGER hProcess, INTEGER lpMinimumWorkingSetSize, INTEGER lpMaximumWorkingSetSize
= SetProcessWorkingSetSize(GetCurrentProcess(), 128*1024*1024, 128*1024*1024)
>But Windows will do it's own thing further on...
>
>AFAIK in Server 2003 there is a lockable SetProcessWorkingSetSize[Ex??],
>read a bit in MSDN...
>
>HTH
>
>thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform