Unix 内存不足

Aid*_*ell 7 sort

我在 Fedora 18 上使用以下命令对包含 200M 行的 25 GB 文件进行排序:

sort -S 10G -T /bigdisk bigfile

由于没有记忆,我正在杀死进程。这个过程在我死前没有最大化我的 RAM(12 GB 可用)并且磁盘空间没问题。

任何有关原因的建议表示赞赏。我确信 sort 可以通过它的分区和合并来管理这个。

来自 dmesg 的更多信息

[87278.935572] Out of memory: Kill process 1971 (sort) score 258 or sacrifice child
[87278.935574] Killed process 1971 (sort) total-vm:4512168kB, anon-rss:4237040kB, file-rss:584kB 
Run Code Online (Sandbox Code Playgroud)

poi*_*ige -1

尝试设置vm.overcommit_memory = 1:\xc2\xab\xe2\x80\xa6

\n\n
\n

当此标志为 1 时,内核会假装始终有足够的内存,直到实际耗尽为止。

\n
\n\n

\xe2\x80\xa6\xc2\xbb

\n\n

使用交换。

\n