LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2005, 04:37 AM   #1
thachp
LQ Newbie
 
Registered: Feb 2005
Posts: 20

Rep: Reputation: 0
Memory Exhausted?


I'm on Fedora Core 2, Celeron 2.0GHz, 1g of ram, 120gb hd. My server has been down a lot lately. I contacted the hosting company, and they told me that I should allocate my memory. How do I do that? What do I do? I've been surfing and searching for solution but no luck. Can this problem be resolved by adding more ram? As of now, only thing i can do is restart the server everytime it happens.

Here is my error log.
Quote:
Allowed memory size of 20971520 bytes exhausted (tried to allocate 12 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 31 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 31 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 12 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 31 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 12 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 31 bytes)
Allowed memory size of 20971520 bytes exhausted (tried to allocate 12 bytes)
free -m
Quote:
total used free shared buffers cached
Mem: 1002 998 3 0 1 17
-/+ buffers/cache: 979 22
Swap: 2047 1667 379

Last edited by thachp; 12-31-2005 at 04:51 AM.
 
Old 12-31-2005, 06:47 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Yes, you need more memory.
You can either add more RAM, or, increase your swap partition from the current 2GB to, say 4GB (but this will obviously be slower than adding more RAM)
 
Old 12-31-2005, 07:59 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Hmmm------if we don't know what is using the memory, then how would we know that we need more?????
I infer that the OP is running a server---doing what? My pea-brain think that servers move data between disk drives and users (clients). Is not RAM used more as a buffer to increase speed??
 
Old 12-31-2005, 10:13 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,151

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
I think you've got an application memory leak. "20,971,520 bytes" ($0140000) is a peculiar memory limit -- not a magic number to me -- but not that large. Such a number does not imply, to me at least, that the system as a whole is out of RAM/swap.
 
Old 12-31-2005, 03:36 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 83
I'd agree that one of the first questions to ask is what's using the RAM now? What does "top" show?
 
Old 12-31-2005, 10:50 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
ok since this thread is about intuition and telepathy i'm going to guess you need to increase
php_value memory_limit 32M
in .htaccess file

that is set it to something -- larger

could also set this with memory_limit = in php.ini
 
Old 01-01-2006, 09:55 AM   #7
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
All of the above. More information is required in order to understand the problem. The free -m was a good start. As pixellany and J.W. said, you need to find out what is using all that memory. As J.W. already said, you can use top in a terminal window to find this. Once top is running press the uppercase "M" key. This will sort the display by the amount of memory that each process is using.

It is also important to tell us the function of the server. Are you running a web server or a mail server or an ftp server? Are you running several server applications at once?

If you are running a web server what software are you running, including version? Are you running the Linux, Apache, MySQL, Php combination? Is this machine doing a lot of database work? If yes are the databases large? If this is a more simple web server are you streaming large video files? How many connections to you normally have? How many connections do you find to be the peak workload?

If you are running a mail server what software are you using? How many users does the mail server service? How large are the mail files/folders?

There are different possibilities available to address each of these situations. It is clear that you have exhausted both physical RAM and your swap space. As tregedar said you may be able to address this either by adding a lot more swap space or adding a lot more RAM or both. My workstation has 1 GB physical RAM and I don't run a lot of applications simultaneously. Still I use all of my RAM and 13 MB of swap space. If a workstation under a light load will use that much memory then certainly a busy server will want more that 1 GB RAM and more than 1 GB of swap space.

Anyway, if you decide to just go ahead and add RAM, swap space, or both, you may fix the problem or you may cover up a problem. Maybe the only real answer is to add RAM and swap space. On the other hand if you provide more information to this thread someone may be able to find a problem that can be addressed in another way.

Good luck.

Last edited by stress_junkie; 01-01-2006 at 10:00 AM.
 
Old 01-04-2006, 02:57 PM   #8
thachp
LQ Newbie
 
Registered: Feb 2005
Posts: 20

Original Poster
Rep: Reputation: 0
^ Thank you guys for the supports. I was able to fix the problems. It was due to couples of reasons. I was able to open the error logs and went on from there.

Here's what i did.
1. increase the max clients in apache and mysql
2. add additional 1 gig of ram.
 
Old 01-04-2006, 03:22 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,151

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
You may have "fixed" it, or you may have simply delayed its return.
 
Old 01-04-2006, 08:16 PM   #10
thachp
LQ Newbie
 
Registered: Feb 2005
Posts: 20

Original Poster
Rep: Reputation: 0
^ Ha ha. I dunno not. I may have delayed its return. But i'm sure it'll stay fine for a while.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
HLFS: sed-4.1.4 & uClibc-0.9.28, Memory Exhausted. Yerp Linux From Scratch 1 01-05-2006 03:26 PM
"Undeleting" data using grep, but get "grep: memory exhausted" error SammyK Linux - Software 2 03-13-2004 04:11 PM
squirellmail, Fatal error: Allowed memory size exhausted illtbagu Linux - Software 6 11-08-2003 06:46 PM
"pipe: memory exhausted" problem nixie Linux - Software 1 09-02-2003 02:56 PM
DMA Pool Exhausted dguy Linux - Hardware 7 05-09-2002 08:58 AM


All times are GMT -5. The time now is 08:01 PM.

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