My photo frame
has had some new pictures added to it recently after which it started to crash. Turns out it was running out of memory. I guess 256Mb of RAM
could not accommodate for a 128Mb JVM
as well as the OS. I decided to add some virtual memory swap space to it only to find that dphys-swapfile
was not installed by default in Minibian
. This article describes the steps I followed to get virtual memory working.
First, this is the kind of error that I was seeing...
This was verified by running 'free'
No swap space! No big deal, just install dphys-swapfile
as the root user
During installation a 512Mb swap file is configured for you, but if you want to change that it can be done by editing the /etc/dphys-swapfile
configuration file. The default is like this...
Now just run the setup and turn on the swap space...
again confirms that the swap space has been added...
These settings stay after a restart, so there is nothing else to do once you've set it up. After these changes I have not had a single crash.
I'd not recommend enabling swap on a Raspberry Pi unless you really need it and don't care about performance. In my case, it doesn't matter if it runs slower since it's just a photo frame, but the same won't apply in all use cases.
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...