When using parallel_sim.sh to run checkpoint simulations in batches, I encountered frequent bad_alloc issues despite having sufficient physical memory. The error logs indicate various causes, but all seem related to memory allocation failures.
**** REAL SIMULATION ****
warn: No dot file generated. Please install pydot to generate the dot file and pdf.
build/RISCV/sim/simulate.cc:194: info: Entering event queue @ 0. Starting simulation...
build/RISCV/cpu/base.cc:1503: warn: Start memcpy to NEMU from 0x7fccd757c000, size=8589934592
build/RISCV/cpu/base.cc:1506: warn: Start regcpy to NEMU
MemoryError: std::bad_alloc
At:
build/RISCV/python/m5/simulate.py(186): simulate
/home/zybzzz/proj/openxiangshan/tools/GEM5/configs/common/Simulation.py(268): benchCheckpoints
/home/zybzzz/proj/openxiangshan/tools/GEM5/configs/common/Simulation.py(850): run_vanilla
/home/zybzzz/proj/openxiangshan/tools/GEM5/configs/example/xiangshan.py(423): <module>
build/RISCV/python/m5/main.py(434): main
I attempted to catch these errors using gdb, but interestingly, they did not occur when running under gdb. Upon closer inspection, I found that gdb automatically disables ASLR (Address Space Layout Randomization) by default. Disabling ASLR resolved the memory allocation issues during batch checkpoint runs. This suggests that the default ASLR level in the system might be too aggressive, leading to memory fragmentation and ineffective allocation during batch execution.
Given this observation, should we consider adding temporary ASLR disabling commands in parallel_sim.sh to mitigate this issue?
I am running on 2 × EPYC 9954 processors with 2.2 TB of memory, launching 100 processes for batch checkpoint execution. After disabling ASLR, the bad alloc issue was resolved.
When using parallel_sim.sh to run checkpoint simulations in batches, I encountered frequent bad_alloc issues despite having sufficient physical memory. The error logs indicate various causes, but all seem related to memory allocation failures.
I attempted to catch these errors using gdb, but interestingly, they did not occur when running under gdb. Upon closer inspection, I found that gdb automatically disables ASLR (Address Space Layout Randomization) by default. Disabling ASLR resolved the memory allocation issues during batch checkpoint runs. This suggests that the default ASLR level in the system might be too aggressive, leading to memory fragmentation and ineffective allocation during batch execution.
Given this observation, should we consider adding temporary ASLR disabling commands in parallel_sim.sh to mitigate this issue?
I am running on 2 × EPYC 9954 processors with 2.2 TB of memory, launching 100 processes for batch checkpoint execution. After disabling ASLR, the bad alloc issue was resolved.