?
Solved

Managing memory allocated to processes

Posted on 2000-04-25
2
Medium Priority
?
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
kiffney earned 200 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

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

765 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