LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   How to clean computer memory space? (http://www.linuxquestions.org/questions/showthread.php?t=4175437393)

rivera 11-16-2012 01:43 AM

How to clean computer memory space?
 
Some times I stop a running program when calculation results start to diverge. But the free memory goes on decreasing with increasing number of program terminations. I do not have reboot authority to clean the occupied cashed memory. Is there some way so that I can increse the free memory space?

druuna 11-16-2012 01:56 AM

Quote:

Originally Posted by rivera (Post 4830580)
Some times I stop a running program when calculation results start to diverge. But the free memory goes on decreasing with increasing number of program terminations. I do not have reboot authority to clean the occupied cashed memory. Is there some way so that I can increse the free memory space?

Is there a valid reason why you want to do this by hand?

Linux memory management works rather well. Cached memory is being freed when needed, no need to do this by hand (although there could be exceptions).

If you really (which I doubt!!!) need to do this by hand:
Code:

sync; echo 3 > /proc/sys/vm/drop_caches

rivera 11-16-2012 02:39 AM

Quote:

Originally Posted by druuna (Post 4830585)
Is there a valid reason why you want to do this by hand?

Linux memory management works rather well. Cached memory is being freed when needed, no need to do this by hand (although there could be exceptions).

If you really (which I doubt!!!) need to do this by hand:
Code:

sync; echo 3 > /proc/sys/vm/drop_caches

Hi Drunna,

I got the following message when I entered the commands.
-bash: /proc/sys/vm/drop_caches: Permission denied

Why I should decrease the occupied cashed memory is that cashed memory goes on increasing when running programs are terminated in the middle due to some numerical errors. This caused free memory required for computation less and less so the computation time increases. This is my experience. I donot the exact reson why inital small cashed memory goes on increasing after exitiing a running program.

druuna 11-16-2012 03:42 AM

Quote:

Originally Posted by rivera (Post 4830602)
I got the following message when I entered the commands.
-bash: /proc/sys/vm/drop_caches: Permission denied

You need root privileges to execute the commands given (the permission denied message should have been an indicator). You mention not having "reboot authority", which could indicate that you cannot execute this command.

Quote:

Why I should decrease the occupied cashed memory is that cashed memory goes on increasing when running programs are terminated in the middle due to some numerical errors. This caused free memory required for computation less and less so the computation time increases. This is my experience. I donot the exact reson why inital small cashed memory goes on increasing after exitiing a running program.
Without doing some dedicated research/trouble shooting you cannot make the assumption that one is the reason for the other.

TobiSGD 11-16-2012 05:20 AM

If a terminated calculation does not release used memory (and I am not talking about cache) than this is a bug in the program and you should contact the developers about that.

rknichols 11-16-2012 09:56 AM

Before doing too much, you should take a look at http://www.linuxatemyram.com/.

It might save some confusion if the label on "free" memory were changed to "memory that is currently wasted because the kernel can't find anything productive to do with it". But, that's a bit much for a column heading, so we're stuck with "free". It is completely normal for the amount of "free" memory to tend toward zero as the system runs.

Now, if this program is creating files in a tmpfs and they are not being deleted, that would indeed be a problem, and one that should be easily corrected.

rivera 11-20-2012 09:18 PM

Quote:

Originally Posted by druuna (Post 4830635)
You need root privileges to execute the commands given (the permission denied message should have been an indicator). You mention not having "reboot authority", which could indicate that you cannot execute this command.

Without doing some dedicated research/trouble shooting you cannot make the assumption that one is the reason for the other.

Thank you so much, druuna,TobiSGD,rknichols for posting great replies.


All times are GMT -5. The time now is 12:20 AM.