donjuanplatinum n00b
Joined: 06 Oct 2024 Posts: 16 Location: China
|
Posted: Sun Oct 06, 2024 2:23 am Post subject: Linux oom is not working |
|
|
Hello everyone, I have a question. It seems that my system's OOM killer won't trigger,I have confirmed that the vm.panic_on_oom=0,vm.oom_kill_allocating_task=0.But when I ran a test software that continuously requested memory, OOM did not work and caused the system to freeze when the memory usage reached 98%
this is my version
Code: |
Linux version 6.6.47-gentoo-x86_64 (root@localhost.localdomain) (x86_64-pc-linux-gnu-gcc (Gentoo 13.3.1_p20240614 p17) 13.3.1 20240614, GNU ld (Gentoo 2.42 p3) 2.42.0) #1 SMP PREEMPT_DYNAMIC Sun Sep 1 12:21:14 CST 2024
|
The Test Software Code
Code: |
use std::alloc::Layout;
fn main() {
let mut size = 50000 * 1024 * 1024;
let mut vec =vec!();
for i in 0.. {
println!("{}",vec.len());
unsafe {
let layout = Layout::from_size_align(size,4096).expect("layout cant assign");
vec.push(layout);
}
}
}
|
When i run this software, the usage of memory Continuous increase, when reached 98%, my system freezed. and oom did not do anything
Moderator note: Fixed some font problems. -- Banana |
|