LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-28-2010, 12:20 PM   #1
razzera
Member
 
Registered: Dec 2009
Posts: 105

Rep: Reputation: 15
out of memory problem


Hello

Im running a Debian webserver with apache2/mysql on a Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz that has 2GB of ram in it. The problem i have that just after a few hours the server gets 99% memoery usage. the load is 0.01 0.02 0.03 but the memoery is at 1.93 GiB used all the time, why is this ?

Last edited by razzera; 03-28-2010 at 04:50 PM.
 
Old 03-28-2010, 01:01 PM   #2
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Rep: Reputation: 17
Dear razzera,
I am new in linux platform. But as per my suggestion you may run top command. Hope it will help you. All the Best
 
Old 03-28-2010, 01:09 PM   #3
razzera
Member
 
Registered: Dec 2009
Posts: 105

Original Poster
Rep: Reputation: 15
i have been looking at top for a while before this post and i get

2166 mysql 20 0 226m 26m 5448 S 0 1.3 0:23.49 mysqld
7351 www-data 20 0 202m 11m 3940 S 0 0.6 0:00.44 apache2
2074 bind 20 0 119m 11m 2220 S 0 0.6 0:00.00 named
7335 www-data 20 0 202m 11m 3900 S 0 0.6 0:00.72 apache2
7216 www-data 20 0 202m 11m 3516 S 0 0.6 0:00.58 apache2
7329 www-data 20 0 202m 10m 3416 S 0 0.5 0:00.12 apache2
7311 www-data 20 0 202m 10m 3356 S 0 0.5 0:00.20 apache2


however i wonder why mysql would take so much memoery since the server currently has almost no traffic ??
 
Old 03-28-2010, 03:14 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
My suggestion is to install 'htop'

Code:
apt-get install htop
Then when you run htop, you can sort (F5) by memory and you can then view which specific daemon or applications are using up all your memory. Let me know what you find...
 
Old 03-28-2010, 03:31 PM   #5
razzera
Member
 
Registered: Dec 2009
Posts: 105

Original Poster
Rep: Reputation: 15
this is what htop is telling me

http://img130.imageshack.us/img130/2272/htop.png

why is everyting taking up so much memory ?

Quote:
Originally Posted by carlosinfl View Post
My suggestion is to install 'htop'

Code:
apt-get install htop
Then when you run htop, you can sort (F5) by memory and you can then view which specific daemon or applications are using up all your memory. Let me know what you find...
 
Old 03-28-2010, 03:36 PM   #6
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Is it possible you are just caching a lot?
Code:
sync; echo 3 > /proc/sys/vm/drop_caches
will clear your cache so you can see how much memory the current running processes are actually using.
 
Old 03-28-2010, 03:49 PM   #7
razzera
Member
 
Registered: Dec 2009
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by damgar View Post
Is it possible you are just caching a lot?
Code:
sync; echo 3 > /proc/sys/vm/drop_caches
will clear your cache so you can see how much memory the current running processes are actually using.
THANKS! this cleared the memoery problem. is there some way to make it not cache like that all the time ??
 
Old 03-28-2010, 04:36 PM   #8
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Quote:
Originally Posted by razzera View Post
THANKS! this cleared the memoery problem. is there some way to make it not cache like that all the time ??
I'm sure there is, but I don't know it. A new thread in the right forum, with a good title will get you a good discussion on the subject. I just made an executable script out of the previous command that I run manually when I need to clear the cache. I'm guessing what you are wanting to do would be in the kernel somewhere.

If this thread is solved, don't forget to mark it as such and if I helped don't forget the thumbs up!

Glad I could help.
 
Old 03-29-2010, 12:34 AM   #9
unix.fresher
LQ Newbie
 
Registered: Dec 2008
Distribution: redhat
Posts: 27

Rep: Reputation: 17
Thanks damgar.
 
Old 03-29-2010, 01:35 AM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Its perfectly normal and correct for Linux to use all the avail memory to cache stuff. Its pointless having RAM installed an not using it. There's loads of qns here on LQ that will tell you the same thing. Do not start fooling with the caching unless

1. you are having performance issues
2. you know what you are doing.
 
Old 03-29-2010, 07:46 AM   #11
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Your screen shot shows you're utilizing 263 MB's of RAM with MySQL, Bind, & Apache running. I can't see what else you have installed but your system is running very light in my opinion unless I am missing something. I can tell you that I have servers that run the same thing on RHEL / CentOS that use 3 times as much as your machine. I wouldn't mess with the cache on the system. Your system looks perfect to me unless I am totally missing something.

-Carlos
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux shared memory segment access problem and x86 Virtual Memory layout. regmee Linux - Kernel 1 08-23-2008 12:11 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
Memory Problem cosmo289 Ubuntu 5 07-08-2006 02:02 AM
RH 9.0 Memory Problem ! ! ! Mustard010 Linux - Hardware 7 11-03-2003 08:21 PM
Help!?! RH 8 Memory Mapping -High Memory-Virtural Memory issues.. Merlin53 Linux - Hardware 2 06-18-2003 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:09 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
Open Source Consulting | Domain Registration