Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use top to see memory usage, I have 65gb ram but only 1.3gb of it free and remaining is shown as used. When I ran my program It gives memory insufficiency error. Although no other program is using the remaining 63.7gb ram it is hold. how can I get free the unused ram?

share|improve this question
    
Please give more details about the program you are trying to run. Linux uses most of the free ram to cache data from the harddisk but clears this caches to get free memory for programs to run. So are you perhaps trying to run a java program? –  theomega Apr 25 '10 at 10:28
    
We need more information about the program you're running. How much memory does it need? Is it 32 or 64 bit? What language is it in? –  developmentalinsanity Apr 25 '10 at 10:40
    
Post the output of top -bn1 | head -n 6 as an edit to your question. –  Dennis Williamson Apr 25 '10 at 13:29
add comment

4 Answers 4

up vote 3 down vote accepted

Too many duplicates to list. But long story short, the memory is in use as cache and buffers, and will be freed as applications consume more real memory.

share|improve this answer
    
yes u r right. I think I am doing wrong on somewhere els. Thnx –  user35153 Apr 25 '10 at 10:40
add comment

If you want the memory not to be used, take it out of the computer and sit it on your desk.

There is a common misunderstanding that free RAM is good. Actually, every byte of RAM that is free represents a failure of the system to make effective use of that RAM. Free RAM won't make your system any faster.

Consider a grossly oversimplified scenario. A program runs, and then finishes. Your operating system has two choices:

1) It could make the memory that held the program free. This requires a specific operation to make it free, and a specific operation to allow it to be used again. And if the program runs again, it will have to be loaded in from disk.

2) It could not make the memory that held the program free. This requires no operation to make it free, but a specific operation might be needed later to move it to another use. And if the program runs again, it will not have to be loaded in from disk.

So, under most conditions, option 2 is a pure win. It saves an operation if the memory needs to be used for something else (it can just switch from one use to another in one step rather than two steps, one to make it free and one to make it not free). And it may save the program from having to be loaded in from disk, which would be a huge win.

So, the short version is, you don't want free RAM.

share|improve this answer
add comment
dylan@oxide:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           123        120          3          0         34         35
-/+ buffers/cache:         50         72
Swap:          243          0        243

The +/- buffers line is your actual memory usage. What program are you trying to run? It's very possible that it's not actually a lack of available memory, but some other issue.

Are you perhaps running a 32 bit operating system in PAE mode on this machine? Your application may want more than 2GB of virtual address space, which PAE cannot provide. (A kernel recompile can bump that up to 3GB, but you really are better off going to 64 bit if that's the case.)

share|improve this answer
add comment

Try :

echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

this will instantly release a lot of memory.

share|improve this answer
    
And also kill performance in certain circumstances if I see this correctly. –  Bobby Aug 20 '12 at 14:39
    
this is a non-destructive operation, and dirty objects are not freeable, the user should run "sync" first in order to make sure all cached objects are freed. –  mnmnc Aug 20 '12 at 22:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.