Programmer's understanding of Memory in the Vi

2020-07-10 05:57发布

I know a fair bit about the Windows Task Manager in XP, but I would like to understand it better in Vista. What is the difference between "Working Set (Memory)" and "Memory (Private Working Set)". What is the Paged Pool, what is the NP Pool (Non-Paged?). How do I use these to determine what is going on with memory usage? As an aside, when you minimize a program it frequently returns 90% of the memory it is using. Is there any way to do this without minimizing it?

2条回答
Ridiculous、
2楼-- · 2020-07-10 06:13

This MSDN blog entry might be informative on the first part of the question. A brief excerpt:

Working set is the subset of virtual pages that are resident in physical memory only; this will be a partial amount of pages from that process.

As discussed in the article, the part about private versus not-private has to do with memory used by the process that can be shared by other processes. If you can't share the memory (perhaps the memory is used by the image of a DLL had to be relocated in memory), it becomes private. Heap memory is also always going to be private.

The reason you see the memory drop dramatically when minimizing a program is that Windows automatically trims the working set of a process whenever it its main window is minimized. See this Microsoft KB article for more, including instructions on how to do this yourself.

The paged pool and non-paged pool memory refers to kernel memory used by the process. Memory from the paged pool can be paged out (removed from physical memory when memory pressure increases). Memory from the non-paged pool will always remain in physical memory, so generally it's preferable for this to stay small. Unless you're writing device drivers, though, as a user-mode application developer you generally won't need to worry about these two items.

查看更多
够拽才男人
3楼-- · 2020-07-10 06:22

Vista's SuperFetch considers free memory to be wasted memory. Better is using it like a cache. This is why you will often see scant free memory in the Task Manager.

查看更多
登录 后发表回答