Jump to content

Welcome, Guest!

ryandigweed

Tutorial: How to free up RAM on your Pi (Debian)

Recommended Posts

How to free up RAM on your Pi (Debian)


Firstly to find out how much of RAM (In Megabytes) is free, type this:

 
$ free -m 



Next, Perform the clean up by removing pagefiles:


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



You may type this again, and see how much of difference there is in the free memory.

 
$ free -m 



I hope this helps. Maybe a quick tip, but it could be useful.


 

Share this post


Link to post
Share on other sites

Keep in mind that this doesn't disable caching, you are only clearing it. So, as your apps start to pull stuff from disk (or write to it) it will be cached again and your memory usage will go up again.

 

- Suramya

Share this post


Link to post
Share on other sites

you must be superuser like this

# echo 3 > /proc/sys/vm/drop_caches

 

 

pi@raspberrypi ~ $ echo 3 > /proc/sys/vm/drop_caches

-bash: /proc/sys/vm/drop_caches: Permission denied

Share this post


Link to post
Share on other sites

Even using sudo fails:

pi@raspbmc:~$ sudo echo 3 > /proc/sys/vm/drop_caches
-bash: /proc/sys/vm/drop_caches: Permission denied

You must be root:

 

pi@raspbmc:~$ sudo -i

root@raspbmc:~# echo 3 > /proc/sys/vm/drop_caches
root@raspbmc:~# 

 

Good tip anycase

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

About Us

Bringing you the latest Raspberry Pi news, tutorials and user forum.

The Fruity Computer

×
×
  • Create New...