i am using my pi to extend my WiFi by outputting the WiFi thought the Ethernet port to another router.
Everything works well until the RAM fills up and I have to reboot the Pi.
Is there a way I can set the RAM to auto clear when it reaches a certain point?
Cheers,
Echo
- RaTTuS
- Posts: 10684
- Joined: Tue Nov 29, 2011 11:12 am
- Location: North West UK
- Contact: Twitter YouTube
Re: Auto Clear RAM
fix your code so it doesn't fill up..
how are you achieving this system ?
how are you achieving this system ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
WARNING - some parts of this post may be erroneous YMMV
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe
-
- Posts: 13955
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: Auto Clear RAM
Sounds like the software you're using has a memory leak. If properly written, it would allocate the space it needs and release space it no longer needs. As the previous poster said: Fix the software.
Re: Auto Clear RAM
If you're not able to fix the memory leak, take a look at the Linux watchdog (https://linux.die.net/man/5/watchdog.conf). It can automatically reboot the system whenever the free memory runs dangerously low. It can even run a "repair" script before resorting to a reboot, which could attempt to kill and restart the offending process. Not a very "nice" solution, but reliable and easy to implement.
Re: Auto Clear RAM
How are you determining your ram is filling up meaning you have to reboot ?EchoEum wrote:i am using my pi to extend my WiFi by outputting the WiFi thought the Ethernet port to another router.
Everything works well until the RAM fills up and I have to reboot the Pi.
Is there a way I can set the RAM to auto clear when it reaches a certain point?
By default Linux will use spare ram to cache recently opened files helping to speed things up, this ram is still available to applications if they need it. For instance looking at the ram on one of my PiBs I get the following output.
Code: Select all
root@draco:~# free -m
total used free shared buffers cached
Mem: 434 345 89 8 40 259
-/+ buffers/cache: 46 388
Swap: 99 0 99
The 2nd line gives a slightly more useful set of values if you want to know what's available for running applications.
Re: Auto Clear RAM
Thanks for all the replies. I did a fresh install on my SD card and everything seems to be working now. 
