我正在编写一个模拟器,它依赖于生成(可能)非常大的问题域。由于数据无法放入 RAM,我使用 4 个四内存映射文件来保存它。这是一个在 64 位 Linux 上运行的 64 位应用程序,具有 8GB 的 RAM。
我的应用程序在多个线程中迭代内存映射并对它们执行读写操作。但是我的程序在启动后不久导致 OOM(没有发生颠簸):
[ 683.899682] Purging GPU memory, 25 pages freed, 12838 pages still pinned.
[ 683.899683] 50 and 0 pages still available in the bound and unbound GPU page lists.
[ 683.899732] Purging GPU memory, 0 pages freed, 12838 pages still pinned.
[ 683.899732] 50 and 0 pages still available in the bound and unbound GPU page lists.
[ 683.901441] gnome-shell invoked oom-killer: gfp_mask=0x240c0d0(GFP_TEMPORARY|__GFP_COMP|__GFP_ZERO), order=3, oom_score_adj=0
[ …
Run Code Online (Sandbox Code Playgroud)