0

私は完全に rootfs 上に Linux を持っています (私が理解しているように、これは ramfs のインスタンスです)。ハードディスクもスワップもありません。そして、メモリを継続的にリークするプロセスを取得しました。仮想メモリは、最終的に物理メモリの 4 倍のサイズに成長します。何が起こっているのか理解できません。rootfs は RAM のみを使用するはずですよね?スワップ先のディスクがない場合、仮想メモリを物理メモリの 4 倍にするにはどうすればよいですか?

4

1 に答える 1

1

割り当てられたすべてのメモリをブロック デバイスでバックアップする必要はありません。glibc の人々は、この動作をバグと見なしています。

BUGS
   By default, Linux follows an optimistic memory allocation
   strategy.  This means that when malloc() returns non-NULL
   there is no guarantee that the memory really is available.
   This is a really bad bug.  In case it turns out that the
   system is out of memory, one or more processes will be killed
   by the infamous OOM killer.  In case Linux is employed under
   circumstances where it would be less desirable to suddenly
   lose some randomly picked processes, and moreover the kernel
   version is sufficiently recent, one can switch off this
   overcommitting behavior using a command like:

       # echo 2 > /proc/sys/vm/overcommit_memory

   See also the kernel Documentation directory, files
   vm/overcommit-accounting and sysctl/vm.txt.
于 2011-04-10T09:48:46.277 に答える