https://github.com/medowic/simple-memory-cleaner
Simple memory cleaner (buff/cache) for Linux
https://github.com/medowic/simple-memory-cleaner
linux memory-cleaner
Last synced: 2 months ago
JSON representation
Simple memory cleaner (buff/cache) for Linux
- Host: GitHub
- URL: https://github.com/medowic/simple-memory-cleaner
- Owner: medowic
- License: mit
- Created: 2024-02-13T18:26:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-13T18:47:06.000Z (5 months ago)
- Last Synced: 2025-02-01T20:09:38.141Z (4 months ago)
- Topics: linux, memory-cleaner
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-memory-cleaner (clmem)
This is a simple script that removes the "buff/cache" from RAM. There nothing differentBut there are some features =)
## Install
One line. One command. And everything is ready!
```sh
curl -fsSL https://raw.githubusercontent.com/medowic/simple-memory-cleaner/master/install.sh | sudo bash
```
## Uninstall
```sh
curl -fsSL https://raw.githubusercontent.com/medowic/simple-memory-cleaner/master/uninstall.sh | sudo bash
```
## Usage
### Manually
You can use the `clmem` command for fast memory cleaning> [!NOTE]
> To use `clmem`, you must be a root or use `sudo````sh
$ sudo clmem
# Cleaned: ... MiB
```
### At background (daemon)
Also, `clmem` works as a daemon to clean up memory periodicallyTo start and stop it, use `systemctl`
```sh
systemctl start clmem # start service
systemctl stop clmem # stop service
```
Usually, `clmem` cleans up memory every 30 minutes, but this value can be changed in `/etc/clmem.conf`:
```
# This is configuration file for simple-memory-cleaner (clmem)# How often will the memory be cleared (in minutes)?
CLEAN_TIME=30
```
Cleaning is set to every 30 minutes (`CLEAN_TIME=30`). You can change this value to whatever you want but it must be not less than `1`.
```
CLEAN_TIME=60 # now, the daemon will clean memory every 60 minutes
```
If you set this value to less than `1`, the daemon will not start
```
CLEAN_TIME=0 # daemon will be stopped with exit-code 1
```
**After changing the value, restart the daemon by running** `systemctl restart clmem`
# License
This is project is under the [MIT License](https://raw.githubusercontent.com/medowic/simple-memory-cleaner/master/LICENSE)