Skip to content

Commit

Permalink
Jemalloc option in README.md (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxarno authored Jan 12, 2025
1 parent f70e077 commit 8d9c549
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ This will reduce GLib memory appetites by reducing the number of malloc arenas
that it can create. By default GLib creates one are per thread, and this would
follow to memory fragmentation.

### Jemalloc
If the arena option doesn't help, you can try replacing the standard allocator with `jemalloc`,
which emphasizes fragmentation avoidance and scalable concurrency support.

To do this, you need to install the `libjemalloc-dev` package.
And pass the following flags for build command:

```
CGO_CFLAGS="-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" CGO_LDFLAGS="-ljemalloc" go build
```


## Contributing

Feel free to file issues or create pull requests. See this [guide on contributing](https://github.com/davidbyttow/govips/blob/master/CONTRIBUTING.md) for more information.
Expand Down

0 comments on commit 8d9c549

Please sign in to comment.