Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Linux oom is not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
donjuanplatinum
n00b
n00b


Joined: 06 Oct 2024
Posts: 16
Location: China

PostPosted: Sun Oct 06, 2024 2:23 am    Post subject: Linux oom is not working Reply with quote

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%
:D
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
Back to top
View user's profile Send private message
druggo
Guru
Guru


Joined: 24 Sep 2003
Posts: 319
Location: Hangzhou, China

PostPosted: Sun Oct 06, 2024 5:50 am    Post subject: Reply with quote

it seems system enter the thrashing before invoke oom killer
you can check the section "What is thrashing?" and "What is the Out Of Memory (OOM) killer?" from the memory faq:
https://landley.net/writing/memory-faq.txt
_________________
AMD FX-8300 / Loongson-2f (lemote-yeeloong)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum