Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
Glenn9999

EmptyWorkingSet Possibilities

Recommended Posts

I recently came upon an API call in Windows called EmptyWorkingSet, which seems to be pretty interesting.  Microsoft's description of it is: "Removes as many pages as possible from the working set of the specified process."  This seems to be pretty interesting in terms of possibilities to try to rein in some of the programs that do memory leaks and the like.  Of course, I can't say I'm too sure that I understand 100% what this API call does.

Anyhow the question I have is if anyone has any experience with it in terms of general system stability and the like - does using it make a difference upon the system in general in terms of program stability, stemming memory leaks, and the like?

Share this post


Link to post
Share on other sites

No, it won't help with leaks. A service that ran once a day could use it to free physical memory after running, but Windows will take that memory as needed anyway. Better not to micromanage the VMM. See SetProcessWorkingSetSize for more background.

Share this post


Link to post
Share on other sites
On 3/2/2018 at 6:34 PM, jumper said:

No, it won't help with leaks. A service that ran once a day could use it to free physical memory after running, but Windows will take that memory as needed anyway. Better not to micromanage the VMM. See SetProcessWorkingSetSize for more background.
 

Okay so basically using that is akin to the old programs that used to allocate all the RAM and then release it to try to "clear RAM".  More or less, just snake oil that causes unnecessary hits to the page file.

Share this post


Link to post
Share on other sites
On 3/5/2018 at 5:50 PM, jumper said:

Usually....

I did a test and confirmed it for myself.  Page Faults go way up when you use EmptyWorkingSet habitually.  It seems all it does is push as much as it can to the disk cache.

But what did you mean by "usually"?

Share this post


Link to post
Share on other sites

There are exceptions. Some apps have been known to crash when available physical memory gets low. So utilities that monitor available memory and automatically free some more when it gets low really can prevent crashes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×