https://github.com/steadybit/memfill
Utility to fill up memory
https://github.com/steadybit/memfill
Last synced: 1 day ago
JSON representation
Utility to fill up memory
- Host: GitHub
- URL: https://github.com/steadybit/memfill
- Owner: steadybit
- License: mit
- Created: 2024-07-30T10:49:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-05T18:27:28.000Z (5 months ago)
- Last Synced: 2026-02-05T21:56:26.521Z (5 months ago)
- Language: Rust
- Size: 104 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# memfill
`memfill` is a small utility that fills up memory for a configured duration. It is used to reproduce memory pressure scenarios during reliability experiments.
## Usage
```
memfill [--ignore-cgroup]
ARGS:
Size of memory to fill up; suffixes: K, M, G or %
Allocation mode; [absolute, usage]
Duration; suffixes: s, m, h, d
FLAGS:
--ignore-cgroup (Linux only) Ignore cgroup limits; compute total/usage from system information instead
-h, --help Print help information
-V, --version Print version information
```
### Examples
Fill 500 MB of memory in absolute mode for 30 seconds:
```bash
memfill 500M absolute 30s
```
Fill memory up to 80% usage for five minutes:
```bash
memfill 80% usage 5m
```
## Requirements
- Linux or Windows (`x86_64`, `aarch64` on Linux)
- No special privileges required for the default mode; reading cgroup memory limits is the only OS-level interaction
## Building
### Prerequisites
- [Rust](https://www.rust-lang.org/tools/install) (stable; toolchain is pinned via `rust-toolchain.toml`)
- [cross](https://github.com/cross-rs/cross) for cross-compilation
- [Docker](https://www.docker.com/) (required by `cross` to run the build containers)
- [GNU Make](https://www.gnu.org/software/make/)
### Build
```bash
make build
```
Cross-compiles release binaries for `x86_64-unknown-linux-gnu`, `aarch64-unknown-linux-gnu`, and `x86_64-pc-windows-gnu`. The artefacts are placed under `target//release/`.
### Run Tests
```bash
cargo test
```
Integration tests under `tests/` use [testcontainers](https://testcontainers.com/), so a working Docker installation is required.
## License
MIT - see [LICENSE](LICENSE).