惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

ryank231231.blog

2024, 你好 - ryank231231.blog 2022,展望 - ryank231231.blog 禁用 Chromium Edge 的更新提示 - ryank231231.blog Looking for the next approach Technical notes - ryank231231.blog 关于 IDA Pro 在 HiDPI 屏幕上的使用 [搬运]东方帝国的兴亡——ELF二十年兴衰沉浮录 - ryank231231.blog Logitech K380 Fn lock - ryank231231.blog 自己编译Lineage OS for LG G7
关于Windows 10 的内存压缩 - ryank231231.blog
博主: ryank231231 · 2020-08-03 · via ryank231231.blog
  • 发布时间:
  • 3391 次浏览
  • 暂无评论
  • 3035字数
  • 分类: 技术 转载
  1. 首页
  2. 正文  
  3. 分享到:

请注意,本文编写于 2141 天前,最后修改于 2141 天前,其中某些信息可能已经过时。

简而言之,它就相当于 Linux 的 ZRAM。

就是在原来分页系统加了一层。当内存不够的时候,分页系统会把不常使用的页保存到磁盘,然后设置该页不存在,下次访问的时候会触发缺页异常,异常处理再从磁盘加载保存的页面数据,重新分配物理页面。
有内存压缩,就是把要置换出去的分页先压缩内存,不保存到磁盘了。缺页的时候从内存压缩中解压,这样显然比磁盘快很多。当内存继续不够的时候,可以把压缩页保存到磁盘,比不压缩保存的数据更少,也更快。而且内存的压缩率往往很高,1:0.5不成问题,那么32g就可以当64g用了。
或许有人会关心效率问题,这个内存压缩的核心还是分页机制,分页系统可以筛选出不常用的页,因此性能是没多大影响的。
https://www.zhihu.com/question/37644704/answer/74889488

6f90d47agw1ex8fozup8pj20o40irtcg.jpg

One of the primary goals of any operating system is to manage and
share resources efficiently. 任何操作系统的主要目标之一就是高效地管理和共享资源。

In Windows 10, we enabled the Memory Manager (MM) to compress
infrequently-accessed memory pages which reduces the amount of reads
and writes to the disk (pagefile) and therefore improves
responsiveness.
在 Windows 10 中,我们使内存管理器(Memory Manager,
MM)能够压缩不常用的内存分页来减少对硬盘(页面文件)的读写,从而提高系统响应速度。
内存管理器并不是这个版本才有的东西,它在这个版本中新增了功能。

There’s a single system store for legacy Windows desktop apps or any
other non-UWP app memory usage, and then one store for each Windows
Runtime app (in order to enable trimming and swapping accordingly).
所有的 Windows 桌面应用和非 UWP 应用共享一个储存区,而每个 UWP 应用都有其独立的储存区(以启用清除和交换功能)。
这句是说系统里有多个储存区,一个是给所有桌面程序的,其它的每个对应一个 UWP 应用,因为它们可以完整地保存和恢复。

since the system process holds the stores in memory, its working set
grows larger exactly when memory is being made available to other
processes
因为 System 进程在内存中保存着所有的储存区,所以在内存被压缩并对其它程序可用的时候,它本身的工作集也增大了。

This will reduce the amount of time spent waiting for IO on all
devices, but it will also improve the expected lifespan of systems
featuring flash-based hard drives. 对所有设备来说,这将减少 IO
等待的时间,而对于使用闪存的设备来说,这还能提高它们的预期寿命。 这里的 systems featuring flash-based
hard drives 是指设备,和前面的 all devices 相对。

Though compression affords the OS more space in memory for a given
application load, paging to disk may still be necessary.
虽然压缩能让系统在开启同样多的程序时拥有更多的可用内存,但这并不是说硬盘上的页面文件就不需要了。

MM simply decompresses the page and puts it back in the requesting
process’s working set MM 只需将对应的分页解压并放回对应进程的工作集中

最后: fault: [n] 中断,绝对不是故障
https://bgm.tv/group/topic/312159

135649bxikb4ce9occ2ico.png
如果你的Win10系统用一些优化软件优化过的话可能会导致内存页合并/压缩功能以及应用程序预读被阉割
对高端配置来说阉割内存压缩功能是好事,但是对低端配置/老机来说可能就是灾难,比如前两年一些千元以下的Atom核心平板电脑。
2G容量的LPDDR3-1600(待机时自动阉割成LPDDR3-866)确实很慢,但是eMMC拿来换页实在太慢了。

检查是不是被阉割以及怎么接回去的方法见上图。首先得打开管理员权限的Powershell。
Get-MMAgent命令查看状态。
我这个系统是祖传Win10 1709,所以ApplicationLaunchPrefetching和OperationAPI为False是正常现象。

ApplicationPreLaunch是应用程序预启动,对应参数是-apl
MemoryCompression是内存压缩,对应参数是-mc
PageCombining是页合并,对应参数是-pc
ApplicationLaunchPrefetching是应用程序启动预取,参数-alp
OperationAPI是操作API,参数-oa(建议不要动的好)

被阉割了想接回去就用Enable-MMAgent命令加参数
想要阉割就用Disable-MMAgent命令加参数
命令和参数中间有个半角空格。
施展刀法之后用Get-MMAgent命令查看状态。
MMAgent是受Superfetch服务控制的。所以要正常使用内存压缩和页合并功能绝对不能阉割Superfetch服务。
https://www.chiphell.com/thread-1960127-1-1.html

关于Windows 10 的内存压缩