occlum/demos/fish/test_per_process_config.sh
Hui, Chunyang 9b1d694830 Add support for per-process memory size configuration with rlimit
Rlimit are now on the same page of memory space limits defined in Occlum.json. Specific
memory size configuration can be set to child process with `prlimit` syscall or using `ulimit`
command in shell script.
2020-07-17 22:07:56 +08:00

14 lines
372 B
Bash

#! /usr/bin/fish
ulimit -a
# ulimit defined below will overide configuration in Occlum.json
ulimit -Sv 102400 # virtual memory size 100M (including heap, stack, mmap size)
ulimit -Ss 10240 # stack size 10M
ulimit -Sd 40960 # heap size 40M
echo "ulimit result:"
ulimit -a
# A high-memory-consumption process
/usr/bin/busybox dd if=/dev/zero of=/root/test bs=40M count=2