上的工具
macOS
用于模拟内存不足的情况
memory_pressure
sudo memory_pressure -S -l critical
上面的命令模拟(
-S
-l
名称
memory_pressure(内存压力)--在内存上应用真实或模拟内存压力的工具
系统
提要
记忆压力[
-l
-p
自由百分比][
-
-l
选择权
施加真实或模拟内存压力(如果指定)
模拟参数),直到生成对应的低内存通知。支持的值为“警告”和“严重”。
-p <percent_free> Allocate memory till the available memory in the system
is <percent_free> of total memory. If the percentage of available memory
to total memory on the system drops, the tool will free memory till
either the desired percentage is achieved or it runs out of memory to
free.
-S Simulate memory pressure on the system by placing it artificially for
<sleep_seconds> duration at the "warn" or "critical" level.
-s <sleep_seconds> Duration to wait before allocating or freeing memory
if applying real pressure. In case of simulating memory pressure, this is
the duration the system will be maintained at an artifical memory level.
描述
对系统施加真实或模拟内存压力的工具
另见