I didn't see the oom-killer in my test machines. But I found large memory leak of the Hackbench with valgrind tool.
# valgrind --leak-check=full --show-reachable=yes ./hackbench 1 process 1000
==24500== LEAK SUMMARY:
==24500== definitely lost: 492 bytes in 21 blocks.
==24500== possibly lost: 0 bytes in 0 blocks.
==24500== still reachable: 160 bytes in 1 blocks.
==24500== suppressed: 0 bytes in 0 blocks.
# valgrind --leak-check=full --show-reachable=yes ./hackbench 20 process 1000
==24597== LEAK SUMMARY:
==24597== definitely lost: 9,840 bytes in 420 blocks.
==24597== possibly lost: 0 bytes in 0 blocks.
==24597== still reachable: 3,200 bytes in 1 blocks.
==24597== suppressed: 0 bytes in 0 blocks.

From that we can get that it will lose 73,800 bytes with running "hackbench 150 process 1000" once. This patch fixed the memory leak problem.
============
After patching
============
# valgrind --leak-check=full --show-reachable=yes ./hackbench 20 process 1000
==26495==
==26495== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
==26495== malloc/free: in use at exit: 0 bytes in 0 blocks.
==26495== malloc/free: 423 allocs, 423 frees, 14,720 bytes allocated.
==26495== For counts of detected errors, rerun with: -v
==26495== All heap blocks were freed -- no leaks are possible.
Signed-Off-By: Jin Bing Guo <guojb@cn.ibm.com>.
1 file changed