Memory leaks 如果rootfs上的内存泄漏会发生什么情况?

Memory leaks 如果rootfs上的内存泄漏会发生什么情况?,memory-leaks,rootfs,Memory Leaks,Rootfs,我有一个完全基于rootfs的linux(据我所知,它是ramfs的一个实例)。没有硬盘,也没有交换。我得到了一个不断泄漏内存的进程。虚拟内存最终会增长到物理内存大小的4倍,如上图所示。我不明白发生了什么事。rootfs应该只接受RAM,对吗?如果没有可交换的磁盘,虚拟内存如何增长到物理内存的4倍?并非所有分配的内存都必须由块设备支持;GLYBC人认为这种行为是一个错误: BUGS By default, Linux follows an optimistic memory allocat

我有一个完全基于rootfs的linux(据我所知,它是ramfs的一个实例)。没有硬盘,也没有交换。我得到了一个不断泄漏内存的进程。虚拟内存最终会增长到物理内存大小的4倍,如上图所示。我不明白发生了什么事。rootfs应该只接受RAM,对吗?如果没有可交换的磁盘,虚拟内存如何增长到物理内存的4倍?

并非所有分配的内存都必须由块设备支持;GLYBC人认为这种行为是一个错误:

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.

谢谢我将阅读vm/overmit记帐和sysctl/vm.txt以了解更多信息。