Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Managing memory allocated to processes

Posted on 2000-04-25
2
Medium Priority
?
164 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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 …
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses

610 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