Clear Cache Ram Ubuntu



Clear Cache Ram Ubuntu

GNU or Linux has amazing Memory Management system for efficient Memory Management but still if you think that any process is occupying your memory then Linux offers the process to clear the RAM cache. The process to do so is given in the following text.
1. Clear Cache in Linux : You can use any of these three options and can clear Cache in Linux without interrupting any other process or service.
i. Clear Only the PageCache :
Here “sync” will clear the file system buffer, “drop_cache” will clean cache without killing any other application or service and “...echo 1 > ….” will clear only the PageCache.
ii. Clear Dentries and Inodes :
Here “sync” will clear the file system buffer, “drop_cache” will clean cache without killing any other application or service and “...echo 2 > ….” will clear Dentries and Inodes.
iii. Clear PageCache, Inodes and Dentries:
Here “sync” will clear the file system buffer, “drop_cache” will clean cache without killing any other application or service and “...echo 2 > ….” will clear PageCache as well as Dentries and Inodes.
2. Clear Swap Space in Linux : To Clear Swap Space in Linux you should run the following command.
3. You can use the following command to make a Script to clear Both RAM Cache as well as Swap Space.
OR
4. You should also use “free -h” command before and after running the above script to check the cache.

As you can see on the screenshot above, Ubuntu Cleaner lets you clear caches, the thumbnail cache that the system creates for the fast loading of directories, apt cache, old kernels, package configs, and unneeded packages. To start cleaning the cache, just click on the Clean button on the bottom right corner. How to clear cache The majority of the most popular Linux distros use systemd these days, thus a systemctl command can be used to clear the memory cache. To clear PageCache only, use this command: $ sudo sysctl vm.dropcaches=1. When the 1.6 GB of real free memory is used up during peak usage, as soon as more memory is demanded (and the 'free' in the first column approaches 0) the OOM killer is invoked, processes are killed, and problems start to arise even though the 'free' in the -/+ buffers/cache row still has about 1.4 GB 'free'.

Clear Cache Ubuntu Terminal

To delete a cache, select the entry and then click the Clean button present at the bottom-right corner of the tool’s UI. Before you jump in and start cleaning everything using Ubuntu Cleaner, keep in mind that caches are there for a purpose (as was explained in the beginning of the tutorial). However, if I can disable this process / clean the cache once after that, I think my system will speed up to some extent. Correct me if I am wrong here. I have also tried Bleachbit memory cleaning, but it doesn't seem to clean the memory cache properly. Also, the feature is still in an experimental stage.