LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-05-2006, 03:45 PM   #1
syberdave
LQ Newbie
 
Registered: Oct 2003
Distribution: slackware
Posts: 13

Rep: Reputation: 0
When SWAP and RAM are out


Hello,

Sometimes, I accidentally run out of available RAM and swap space. When that happens, the system starts swapping VERY heavily and makes me unable to kill some processes.

I remember that on 2.4 kernels, it will automatically kill processes when it cannot allocate more RAM.

How would I set it so that the 2.6 kernel would kill processes instead of freezing up?

Thanks.
 
Old 01-05-2006, 11:28 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
just make a swap file for extra swap space
 
Old 01-06-2006, 05:31 PM   #3
Gunark
LQ Newbie
 
Registered: May 2004
Posts: 13

Rep: Reputation: 0
Is there some sort of daemon or utility out there that could monitor your free RAM and warn you / freeze processes when you're almost out? I've accidently ran out a few times while in KDE (see my thread about X taking 460+ megs of RAM ), and it gets pretty ugly. Often I can't even kill X with Ctrl+Alt+Backspace. It'd be nice if I had something that would watch my remaining free memory and stop whatever is eating it before it's too late.
 
Old 01-06-2006, 10:09 PM   #4
syberdave
LQ Newbie
 
Registered: Oct 2003
Distribution: slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Gunark
Is there some sort of daemon or utility out there that could monitor your free RAM and warn you / freeze processes when you're almost out? I've accidently ran out a few times while in KDE (see my thread about X taking 460+ megs of RAM ), and it gets pretty ugly. Often I can't even kill X with Ctrl+Alt+Backspace. It'd be nice if I had something that would watch my remaining free memory and stop whatever is eating it before it's too late.
Gkrellm can monitor memory usage and alert you when you're getting close. It can also run a command, so you can write a script to kill processes.

I usually have enough RAM and swap, but sometimes, I accidentally go over the limit. For example, this flash movie tried to load a whole video into memory.

I guess there's no easy way of preventing something like this from happening, except a huge swap partition/file.
 
Old 01-06-2006, 10:44 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
Out of curiousity, how much RAM and how much swap are you running?
 
Old 01-06-2006, 11:58 PM   #6
syberdave
LQ Newbie
 
Registered: Oct 2003
Distribution: slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by J.W.
Out of curiousity, how much RAM and how much swap are you running?
Code:
synide:~# free
             total       used       free     shared    buffers     cached
Mem:        255136     252812       2324          0      17712      40492
-/+ buffers/cache:     194608      60528
Swap:       259544     243644      15900
256MB of RAM and ~253MB of swap.
 
Old 01-07-2006, 12:13 AM   #7
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 48
Quote:
Originally Posted by Gunark
Is there some sort of daemon or utility out there that could monitor your free RAM and warn you / freeze processes when you're almost out?
There is ulimit command, see ulimit -a for current settings. It also gives you switches with which you can set the limits. You have to do it from the login shell. It doesn't warn you or anything, but it prevents the system from freezing and is really "the linux way" of doing this. Personally I don't like gkrellm, it just seems like a geek toy to me.

Last edited by alienDog; 01-07-2006 at 12:18 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use RAM as swap??? oneandoneis2 Linux - General 3 08-19-2004 04:48 AM
Not using RAM and Swap much ? ruwach Linux - Hardware 2 06-11-2004 07:26 AM
RAM and Swap shiny_spoon Linux - General 5 01-13-2004 02:27 PM
No SWAP but all RAM!! hari_seldon99 Linux - General 3 01-13-2004 10:48 AM
why swap should be twice of RAM? whitefox Slackware 17 04-19-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration