public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Kernels Out Of Memoy(OOM) killer Problem ?
@ 2005-08-09  7:52 vinay
  2005-08-09  8:06 ` Xavier Roche
  0 siblings, 1 reply; 3+ messages in thread
From: vinay @ 2005-08-09  7:52 UTC (permalink / raw)
  To: linux-kernel

Hi all.

I have a problem with linux kernel's Out Of Memory (OOM) killer.
I wanted to know, is there any way that we can force OOM killer to send a signal other than SIGKILL to kill a process when ever OOM detects a system memory crunch. 
Actually I have an application that is getting killed by OOM killer when the 
system runs out of memory. It seems like OOM killer is sending SIGKILL to the 
process. As SIGKILL cannot be caught by a process, my application is exiting 
without doing proper cleanup. 
    Is there any way that we can force OOM killer to send a signal other than
SIGKILL ? So that my application can call the signal handler and do proper cleanup before exiting. 

I searched through Google and came acorss some solution -
Like setting the capability of a process to CAP_SYS_RAWIO will force the OOM killer to send SIGTERM. I tried to set the capability of my application to CAP_SYS_RAWIO using capset() system call, but still then OOM killer is sending SIGKILL. 

Could anybody please help me out with this problem ?
Any pointers are welcomed.

Thanks in advance.

Vinay.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Kernels Out Of Memoy(OOM) killer Problem ?
  2005-08-09  7:52 Kernels Out Of Memoy(OOM) killer Problem ? vinay
@ 2005-08-09  8:06 ` Xavier Roche
  0 siblings, 0 replies; 3+ messages in thread
From: Xavier Roche @ 2005-08-09  8:06 UTC (permalink / raw)
  To: linux-kernel

vinay wrote:
> I have a problem with linux kernel's Out Of Memory (OOM) killer.
> I wanted to know, is there any way that we can force OOM killer to send a signal other than SIGKILL to kill a process when ever OOM detects a system memory crunch. 

As far as I understand the kernel, oom is called when the system has no
memory pages left, and MUST get one to continue normal (ie. kernel)
processing. The kernel just do not have the time to execute some
user-space code, it MUST get free pages where they are (and hence, kill
immediately some innocent process).

This condition should not occur without using overcommit. Are you sure
you are not using overcommit ? (cat /proc/sys/vm/overcommit_memory)

To dasable it:
echo 0 > /proc/sys/vm/overcommit_memory

Overcommit is quite dangerous on production systems, because it leads to
oom kills on heavy loads (at least, this is what I experienced).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  Kernels Out Of Memoy(OOM) killer Problem ?
@ 2005-08-09  9:23 vinay
  0 siblings, 0 replies; 3+ messages in thread
From: vinay @ 2005-08-09  9:23 UTC (permalink / raw)
  To: Xavier Roche, linux-kernel

Hello Xavier.

Thanks for replying.
I checked that the /proc/sys/vm/overcommit_memory is already set to 0.

In my case the problem is that I don't have many options like changing
the overcommit_memory etc.
Only thing I need to do is, have a proper cleanup will exiting the application.  As the application is receiving SIKILL from OMM killer the required signal handler is not getting called and no cleanup is happening.
So could you please suggest me that what could be done in this regard.

Thanks and Regards

Vinay.

> -----Original Message-----
> From: Xavier Roche [mailto:roche+kml2@exalead.com]
> Sent: Tuesday, August 9, 2005 08:06 AM
> To: linux-kernel@vger.kernel.org
> Subject: Re: Kernels Out Of Memoy(OOM) killer Problem ?
> 
> vinay wrote:
> > I have a problem with linux kernel's Out Of Memory (OOM) killer.
> > I wanted to know, is there any way that we can force OOM killer to send a signal other than SIGKILL to kill a process when ever OOM detects a system memory crunch. 
> 
> As far as I understand the kernel, oom is called when the system has no
> memory pages left, and MUST get one to continue normal (ie. kernel)
> processing. The kernel just do not have the time to execute some
> user-space code, it MUST get free pages where they are (and hence, kill
> immediately some innocent process).
> 
> This condition should not occur without using overcommit. Are you sure
> you are not using overcommit ? (cat /proc/sys/vm/overcommit_memory)
> 
> To dasable it:
> echo 0 > /proc/sys/vm/overcommit_memory
> 
> Overcommit is quite dangerous on production systems, because it leads to
> oom kills on heavy loads (at least, this is what I experienced).
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-09  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-09  7:52 Kernels Out Of Memoy(OOM) killer Problem ? vinay
2005-08-09  8:06 ` Xavier Roche
  -- strict thread matches above, loose matches on Subject: below --
2005-08-09  9:23 vinay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox