简体   繁体   English

在64位Linux中交换空间

[英]Swap space in 64 bit Linux

I have a 64 bit Linux (SUSE 10) dual processor. 我有一个64位Linux(SUSE 10)双处理器。 When I run my process it uses around 4 G of virtual memory. 当我运行我的进程时,它使用大约4 G的虚拟内存。 Only 3G is resident memory. 仅3G是常驻内存。 Rest around 9G memory is free. 9G左右的内存可用。 How to load this 1 G also in RAM? 如何将这1 G也加载到RAM中? Why it is still in swap space why kernel can't load this into RAM when all the RAM is available. 为什么它仍然在交换空间中,为什么当所有RAM都可用时内核无法将其加载到RAM中。

Rahul 拉胡尔

The kernel could load the data into memory. 内核可以将数据加载到内存中。 However, when they are not used, it choses to write them out to the swap file. 但是,当不使用它们时,它选择将它们写出到交换文件中。

If you absolutely want the data in memory, you should either turn off all swap files (using swapoff(8)), or lock the specific pages into memory, using mlock or mlockall. 如果您绝对希望将数据存储在内存中,则应该关闭所有交换文件(使用swapoff(8)),或者使用mlock或mlockall将特定页面锁定到内存中。

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

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