Solved

Managing memory allocated to processes

Posted on 2000-04-25
2
157 Views
Last Modified: 2013-12-16
Recently I've had a problem with my linux machine where the disk starts thrashing and it rapidly degenerates into an unresponsive state where the disk is constantly accessing. If I catch it quick enough, I can reboot with ctl-alt-del; otherwise it's the reset button. The symptoms seem to point to a memory leak on a massive scale, where a process is rapidly filling all available real and virtual memory. It seems to be associated with running StarOffice, but I could be wrong.

I have two questions:

1. How can I find out which process is causing this, keeping in mind that once the problem has started it's just a few minutes or seconds until complete system unusability.

2. How can I prevent this from happening? Is there a way to limit the resources resources any single process is allowed to use?

Thanks,
Avdi
0
Comment
Question by:avdi
2 Comments
 
LVL 4

Accepted Solution

by:
kiffney earned 50 total points
ID: 2749919
To find out what's doing this, you could try to run top as a background process, putting its output to a file.  Something like this:

top -b -n 100 -d 15 >> top.out &

would run top as a background process, writing its output to top.out, for 25 minutes (d 15 means every 15 seconds print the output, and n 100 means do this 100 times - alter this to suit).  Then run staroffice or whatever you suspect and then later you can look at top.out to see what's the hog (look at the percent memory column).

To restrict the bad process, if you use the bash shell it has a ulimit command that you can use when you start the process to restrict its memory use.  'man bash' for the gory details.  I'm not sure it will do you much good since whatever app is sucking all memory will probably crash once it can't get any more.  

0
 

Author Comment

by:avdi
ID: 2750035
Thank you very much! I particularly like your solution for question 1; others had suggested using top but yours is the only feasible method I have seen.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now