LinuxQuestions.org
Visit Jeremy's Blog.
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 11-02-2000, 02:02 AM   #1
toddclark
LQ Newbie
 
Registered: Nov 2000
Posts: 1

Rep: Reputation: 0

I have been battling a problem with a newly installed web server which I have had online for about two weeks now.

I started with a Redhat 7 box running MySQL and Apache complete with 256mb of RAM. After about a day the system would freeze completely. I never got a message as why it was crashing until the final one when I saw the screen said something to the effect there was not enough SWAP. Hmmm, it was working fine and showed plenty of memory when I booted it up.

So I installed another 256mb of RAM and let it run. Throughout the day I watched the memory drop from 400mb available to 10mb available. Then it started eating into the swap:

--------------------------------------------------------------------------
From top:

Mem: 516072K av, 499196K used, 16876K free, 39208K shrd, 225204K buff
Swap: 160608K av, 704K used, 159904K free 207812K cached
-------------------------------------------------------------------------
Like a virus the swap is being utilized more and more. 20 minutes ago it was using 500k, now it is 704k.

What is going on here? Is this what is known as a memory leak? How do I find out where the leak is?

I have heard from some that Linux will utilize RAM not being used and release it as needed. If this is true why is it using the swap. I always thought swap was for emergencies when resources are low. With 512mb of ram and at a quiet time of the day should it even be dipping into the swap?







 
Old 11-04-2000, 06:05 PM   #2
Larry James
Member
 
Registered: Jun 2000
Location: Buffalo, New York
Distribution: Ubuntu, Raspbian
Posts: 381

Rep: Reputation: 40
Someone might have a more direct approach, but a general approach to analyze this is to write a routine that will report your memory usage.

Write a bach file called top.sh, for instance, with the fillowing lines:

----------------------
#!/bin/bash

while [ 1 = 1 ]
do
top -c -n1 > top.out.$$
sleep 300
done
------------------------

This will create an output file every five minutes, with a unique number extention. You can execute it in it's own separate terminal screen or execute it in the background with:

./top.sh&

Since it'll make 12 files an hour, you might want to put it in it's own subdirectory so that you can easily sort them or remove then when you finish the task.

You should now easily be able to identify which programs are starting to consume your resources.

-- L. James
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
general memory utilization Tylerious Linux - General 5 09-01-2005 01:25 PM
cpu and memory utilization laxmi_cs Linux - General 2 08-29-2005 04:06 PM
High memory utilization dav7500 Linux - General 7 03-05-2004 05:07 PM
CPU & memory utilization rgerhards Linux - Newbie 2 12-03-2003 11:24 AM
Red Hat Memory Utilization chewy Linux - General 3 03-05-2003 06:22 PM

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

All times are GMT -5. The time now is 02:36 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration