I'm using Ubuntu 18.04 and 4GB RAM with CPU 4.
I don't have too much memory left, so my computer works slowly and crashes. What would you recommend me to remove from directories? Or some command other than apt autoremove
and apt autoclean
because that's not enough. I have nothing to uninstall from the Ubuntu Software because there are only the most important things left. Please help :(
-
24GB should be fine running Ubuntu 18.04. How much swap space are you using? And what applications are you seeiong the slow down? Try not to leave too many application running and avoid using Chrome browser, you'll be fine.– Bernard WeiJul 27, 2018 at 18:43
-
1Possible duplicate of How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?– David FoersterJul 27, 2018 at 22:26
-
Do you mean disk space when you say memory?– Martin ThorntonJul 28, 2018 at 15:22
3 Answers
I'm just answering this old post to hopefully gain some reputation points... When dealing with low memory, I use this nifty little command to clean caches and buffers, saves me from having to use swap most of the time. I only have to use this command once every 2 or 3 days. I suppose this is what you're looking for?
free -h && sudo sysctl -w vm.drop_caches=3 && sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && free -h
-
Caches will be dropped automatically whenever applications ask for more memory. This will probably lead to an decrease in performance.– vidarloNov 18, 2019 at 6:05
There's a couple things you can do. Some of them were already outlined in How can I improve Ubuntu overall system performance?. Here's a few simple suggestions you can try right now:
Switch to a lighter desktop, you don't need to reinstall, you could just install a desktop session such as
xfce
or install metapackage for another flavor, such asXubuntu
edition withsudo apt-get install xubuntu-desktop
Add more swap, either via partition or swap file. I've a script for adding swap files to make that process easier.
Configure swappiness to help the system handle memory-intensive apps. See also: SwapFaq
Disable certain services. Which services to disable will depend on your needs.
Buy more RAM. Make sure you buy modules with correct frequency and type.
- Consider tuning resource usage for certain processes and niceness values
- Consider some of the cleanup suggestions. BleachBit is a well-known and pretty good utility for that.
Check real-time memory usage via the following commands:
watch -n 1 free -m
watch -n 1 cat /proc/meminfo
In returned outputs focus on Buffers, MemTotal, MemFree, Cached, Active, Inactive, etc,...
You can use the following command to free up memory either used or cached (page cache, inodes, and dentries):
sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches***