简体   繁体   English

将PURGE集成到Mac OS X应用程序中

[英]Integrating PURGE into Mac OS X Application

I want to run command line "purge" programmatically. 我想以编程方式运行命令行“purge”。 I know that I can do a shell exec and call "purge" but my problem is that purge is not included in Mac OS 10.6 and below and will be installed if you install Developer Tools. 我知道我可以做一个shell exec并调用“purge”但我的问题是在Mac OS 10.6及更低版本中不包含清除,如果你安装了Developer Tools,它将被安装。 Wondering how I can ship purge via my application and/or install that if is not there. 想知道我如何通过我的应用程序发送清除和/或安装,如果不存在。

More info: 更多信息:

Platform : MAC OS X 
 IDE:  XCode 4.6
 Lang: Obj-C

Don't. 别。

The purpose of purge is described in the manual thus: 因此,手册中描述了purge的目的:

Purge can be used to approximate initial boot conditions with a cold disk buffer cache for performance analysis. 清除可用于通过冷磁盘缓冲区高速缓存来近似初始引导条件以进行性能分析。

The only effect that it has on an end-user's system is to make the system perform worse while the cache is repopulated. 它对最终用户系统的唯一影响是在重新填充缓存时使系统性能更差。 It should NOT be used as part of "memory cleaner" tools, as the only effects it has are negative. 应该被用作“内存清理”工具的一部分,因为它唯一的影响是负面的。 (Indeed, these tools should not be used.) If the system actually needs memory, disk caches will be purged as necessary. (实际上,不应使用这些工具。)如果系统实际需要内存,则将根据需要清除磁盘缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM