编程清除Windows 7备用内存 [英] Clear the windows 7 standby memory programmatically

查看:1913
本文介绍了编程清除Windows 7备用内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我有一些问题,我的系统运行内存。过了好一会儿,发现发生了什么事情,但我最终决定,当我复制大量数据,以我的机器通过文件共享的等效大量的内存被放入待机。任务管理器不显示,显示待机内存使用情况,但是资源监视器一样。起初,我只能得到内存回重新启动,但我最终我发现Sysinternals的家伙写了一个伟大的工具来释放内存(下面的链接)。

Recently I've had some problems with my system running out of memory. It took a while to discover what was going on, but I eventually determined that when I copied large amounts of data to my machine from a file share an equivalently large amount of memory was put into 'Standby'. Task Manager doesn't appear to show the Standby memory usage, but Resource Monitor does. At first I could only get the memory back by rebooting, but I eventually I discovered that the SysInternals guys had written a great utility to free the memory (link below).

下面是备用内存简短的Blurb的:

Here is a brief blurb on Standby memory:

在待机列表包含已从工艺工作集,从而有效地使待机列表中的高速缓存中删除未修改的页面。如果一个进程需要的页面是待机列表中,则存储器管理器立即页面返回到其工作集。 可用于内存分配的候补名单上的所有网页。如果进程请求内存,内存管理器可以采取一个页面从备用名单,对其进行初始化,并分配给调用进程。这就是所谓的再利用的页面。 备用名单上的页面通常是从最近使用的文件。通过保持这些网页的待机列表中,则存储器管理器减少了需要从磁盘读取信息。磁盘读取会降低系统的响应能力。

The Standby list contains unmodified pages that have been removed from process working sets, which effectively makes the Standby list a cache. If a process needs a page that is on the Standby list, the memory manager immediately returns the page to its working set. All pages on the Standby list are available for memory allocation requests. If a process requests memory, the memory manager can take a page from the Standby list, initialize it, and allocate it to the calling process. This is called repurposing a page. Pages on the Standby list are often from recently used files. By keeping these pages on the Standby list, the memory manager reduces the need to read information from the disk. Disk reads can decrease system responsiveness.

(这是从这里的文件:<一href="http://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/MemorySizingGuidanceWin7.docx"相对=nofollow>内存调整指导

(this is from the document here: Memory Sizing Guidance

下面是一个链接到该工具: RAMMAP

Here is a link to the tool: RAMMap

我的问题是:

有没有人有一个想法如何做到这一点编程?理想情况下,我想用C#,但我会AP preciate任何指针,可以帮助我得到一个答案。

Does anyone have an idea how do this programmatically? Ideally I'd like to use C#, but I would appreciate any pointers that might help me get to an answer.

谢谢!

推荐答案

秘密似乎是在过程黑客源$ C ​​$ C(这是在C语言)。纵观code,你会看到这似乎是一个有前途的命令 MemoryPurgeStandbyList 当我们选择在GUI中的空待机列表选项调用。

The secret seems to be in the Process Hacker source code (which is in c language). Looking at the code, you'll see a promising command MemoryPurgeStandbyList which seems to be called when we choose the "empty standby list" option in the GUI.

memlists.c(227, 35): command = MemoryPurgeStandbyList;
ntexapi.h(1475, 5): MemoryPurgeStandbyList,

http://processhacker.sourceforge.net/

也可以在这里为命令行版本。

这篇关于编程清除Windows 7备用内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆