Solved

Managing memory allocated to processes

Posted on 2000-04-25
2
161 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

733 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