tags:

views:

245

answers:

2

Has any one used SetProcessWorkingSetSize ? I am thinking of using it as my application runs out of Virtual Memory ?

+1  A: 

How would it help you if you are running out of Virtual memory?

Working set is the set of memory pages in the virtual memory of a process that are currently resident in physical memory.

I dont think that changing the working set would help you. You need a better memory management strategy like using memory mapped files.

Canopus
A: 

Yes. I had an application which by default would close down entirely but keep listening for certain events. However, most of my code at that point would not be needed for a long time. To reduce the impact my process made, I called SetProcessWorkingSetSize(-1,-1);. This meant Windows could take back the physical RAM and give it to other apps. I'd get my RAM back when events did arrive.

That's of course unrelated to your situation, and I don't think you'd benefit.

MSalters