Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hakavlad committed Jul 26, 2020
1 parent 7ed1137 commit 0fc9ed1
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,41 @@ $ sudo make uninstall
Just restart the service after starting GUI session, and executables/libraries will be locked.

## Effects

- OOM killer comes faster.
- OOM killer comes faster (especially with noswap).
- Fast system reclaiming after OOM.

## Demo

https://www.youtube.com/watch?v=vykUrP1UvcI

On this video: running fast memory hogs in a loop on Debian 10 GNOME, 4 GiB MemTotal without swap space.

- 1. prelockd enabled: about 500 MiB mlocked. Starting `while true; do tail /dev/zero; done`: no freezes. The OOM killer comes quickly, the system recovers quickly.
- 2. prelockd disabled: system hangs.
- prelockd enabled: about 500 MiB mlocked. Starting `while true; do tail /dev/zero; done`: no freezes. The OOM killer comes quickly, the system recovers quickly.
- prelockd disabled: system hangs with `while true; do tail /dev/zero; done`.

## Config

$SYSCONFDIR/prelockd/prelockd.conf
`$SYSCONFDIR/prelockd/prelockd.conf`

https://github.com/hakavlad/prelockd/blob/master/prelockd.conf

(to be documented)

## How to configure

Edit the config and restart the daemon.

## Save snapshot

Run `sudo prelockd -w` to save list of current mmapped files in `/var/lib/prelockd/saved_snapshot`. This list may be mlocked at the next `prelockd` startup.

## Defaults

- Maximum file size that can be locked is 10 MiB. Self RSS limit: 5% MemTotal or 512 MiB.

## Debug

Set `$DEBUG = True` in the config.

## TODO

- Add and a man page.
Expand Down

0 comments on commit 0fc9ed1

Please sign in to comment.