LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 04-28-2004, 12:48 PM   #1
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
system ram never being reclaimed??


once my computer is up and running for a few hours, my ram is 85% all maxed out. i have 384MB. even tho there will be hardly any processes running, ram usage stays at 85% and higher. what i do is run this prog:
Code:
int main() { while(1) malloc(0x1000); return 0;}
until the kernel kills it. at that point all the system ram is reclaimed and im back down to using only 10% of my total ram. is this correct behavior?? shouldnt that ram be reclaimed automatically when processes stop running?
 
Old 04-28-2004, 01:42 PM   #2
watashiwaotaku7
Member
 
Registered: Oct 2002
Location: wisconsin -- The Badger state
Distribution: gentoo
Posts: 654

Rep: Reputation: 30
this is correct behaviour, linux does not use the same model for memory use as windows does, it takes almost no time to clear the ram but a perceptible pause to load data into it, if your ram is not being used, it is not helping your computer to process data therefore linux leaves files in the ram under a "cached" status, with a low priority this data remains stored until the ram is needed for another application in hopes that if the data is needed again it will not have to resort to pulling it from a much slower hdd which results in increased performance, your little process is actually slowing you down and probably is annoying in itself to have to use it, unless there is a memory leak let your ram fill up and enjoy the benefits it gives you
 
Old 04-28-2004, 02:22 PM   #3
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Original Poster
Rep: Reputation: 30
thanks for good answer.
 
Old 05-20-2004, 03:14 PM   #4
HCLogo
Member
 
Registered: Apr 2004
Location: Ontario, Canada
Distribution: Kubuntu (KDE 4.1)
Posts: 59

Rep: Reputation: 15
so what you're saying is that I shouldn't be worried that most of my RAM is being used? (as long as I don't notice a slow-down that is... )
 
Old 05-20-2004, 03:36 PM   #5
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Sure -- the moment a process needs more RAM the file buffers will be shrunk automatically.
To see how much of your RAM is used for processes and for buffers use the 'free' command -- the line that says '+/- buffers/cache' shows only the RAM used by your programs.
So relax -- Linux just puts your RAM to good use. And it's got its priorities right: your programs get all the RAM they need, the leftover's for buffers
 
Old 05-20-2004, 10:43 PM   #6
HCLogo
Member
 
Registered: Apr 2004
Location: Ontario, Canada
Distribution: Kubuntu (KDE 4.1)
Posts: 59

Rep: Reputation: 15
Thumbs up

Thanks, just wanted to make sure I read that right.
 
  


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
New RAM, system freeze/crash MrLizard Linux - Hardware 11 04-27-2005 04:57 AM
How to make a system that lives entirely in RAM? MartinN Linux - General 9 10-31-2004 03:53 PM
howto know how much RAM does my system sees hq4ever Linux - Newbie 4 07-09-2004 01:13 PM
System not registering RAM chip upgrade tireseas Linux - Hardware 1 01-12-2004 02:59 PM
Windows reclaimed daul booted drive tkofkc Linux - Newbie 4 12-05-2002 12:58 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration