This is a rewrite of the original project in C++, for use please go there.
Zmem is a tool for monitoring virtual memory on Linux systems, focused specifically on swap usage. With detailed per-process swap usage and zswap statistics like compression ratio and zswap compressed cache, zmem helps keep track of your system's memory usage and optimize performance.
The name Zmem comes from the fact that it is inspired by Linux kernel features zswap and zram, both of which start with the letter Z. Zmem similarly focuses on memory-related information, hence the name.
Zmem-cpp is a suffix indicating that the Zmem application is written in C++, hence the name.
cd zmem-cpp
meson setup build --prefix=/usr
ninja -C build
sudo ninja -C build installTo use Zmem-cpp, simply run the command below in your terminal:
zmem-cppor if you want per-process swap usage:
zmem-cpp -p| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
zmem-cpp -p |
1.8 ± 0.2 | 1.4 | 2.5 | 1.00 |
zmem-cpp-old -p |
7.9 ± 1.6 | 6.4 | 12.1 | 4.25 ± 0.94 |
zmem -p |
2.0 ± 0.2 | 1.6 | 2.5 | 1.07 ± 0.15 |
| Command | Mean [µs] | Min [µs] | Max [µs] | Relative |
|---|---|---|---|---|
zmem-cpp -s |
959.4 ± 82.6 | 642.1 | 1130.4 | 1.00 |
zmem-cpp-old -s |
1111.4 ± 125.5 | 730.8 | 1351.9 | 1.16 ± 0.16 |
zmem -s |
1358.0 ± 187.3 | 1042.6 | 1663.6 | 1.42 ± 0.23 |
Not much to do, but you can fork it if you really want to :P
Zmem-cpp is licensed under the GPL3 license as the original. See LICENSE for more information.
- Write another code for more controlled file reading and avoid thread delays
TYSM for checking the C++ reference, don't forget to check the repository of xeome, which is the original owner of the project.

