Skip to content

Commit 8d9c549

Browse files
authored
Jemalloc option in README.md (#461)
1 parent f70e077 commit 8d9c549

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ This will reduce GLib memory appetites by reducing the number of malloc arenas
106106
that it can create. By default GLib creates one are per thread, and this would
107107
follow to memory fragmentation.
108108

109+
### Jemalloc
110+
If the arena option doesn't help, you can try replacing the standard allocator with `jemalloc`,
111+
which emphasizes fragmentation avoidance and scalable concurrency support.
112+
113+
To do this, you need to install the `libjemalloc-dev` package.
114+
And pass the following flags for build command:
115+
116+
```
117+
CGO_CFLAGS="-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" CGO_LDFLAGS="-ljemalloc" go build
118+
```
119+
120+
109121
## Contributing
110122

111123
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.

0 commit comments

Comments
 (0)