Reputation: 35
I'm testing and embedded linux CPE with Busybox;
BusyBox v1.00 (2012.07.10-03:48+0000) multi-call binary
I want to try consuming all virtual memory available on the box to test the behavior of the OOM killer.
Here the memory stats:
# free
total used free shared buffers
Mem: 27876 21824 6052 0 708
Swap: 0 0 0
Total: 27876 21824 6052
#
The problem is that the tools on the CPE is very limited, so commands like "vi", "dd" dont exist.
I found an article on the web: http://linuxdevcenter.com/pub/a/linux/2006/11/30/linux-out-of-memory.html
But haveing problems executing the scripts, because of the lack of build in tools on the device.
Any ideas how I can consume all available memory on command line?
Upvotes: 1
Views: 1070
Reputation: 7216
I haven't tested it under busybox but i fork bomb may do the trick (I belive :(){ :|: & };:
) should work on any ksh). It will spawn processes recursively so it will consume all of resources at some point (unless you run out of, say, pids faster - but I would think that on embedded devices memory is primary concern).
Upvotes: 1