You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,9 @@ library is already used by some larger businesses (which is cool!), and I care a
15
15
Please discuss any bigger changes with me **before** submitting a Pull Request - I can help you refine your idea better
16
16
that way, and I don't want to waste anybody's time: [Discussions](https://github.com/lopcode/vips-ffm/discussions).
17
17
18
+
As part of a pull request I will probably edit commits on the branch, and will squash them down, but will be careful to
19
+
retain your contributor metadata so you're named appropriately as a contributor on GitHub.
20
+
18
21
I haven't currently defined a code of conduct for this project specifically, but please refer to the CoC [in libvips](https://github.com/libvips/libvips/blob/master/CODE_OF_CONDUCT.md)
Copy file name to clipboardExpand all lines: README.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,6 +193,43 @@ like Android where it's hard to set the system library path), you can do so usin
193
193
* glib: `vipsffm.libpath.glib.override`
194
194
* gobject: `vipsffm.libpath.gobject.override`
195
195
196
+
## Operationalisation
197
+
198
+
libvips maintain [a checklist](https://www.libvips.org/API/8.17/developer-checklist.html#linux-memory-allocator) of
199
+
things to be aware of when using the library. Of particular note for vips-ffm is memory usage - especially if the library
200
+
is used for long-running application (like a server).
201
+
202
+
#### Operation Cache
203
+
204
+
At the time of writing, libvips maintains a cache of the 100 most recent operations ([see docs](https://www.libvips.org/API/8.17/how-it-works.html#operation-cache)).
205
+
If running an image proxy, or something that processes lots of different images, you won't see any benefit, and can disable it:
206
+
207
+
```java
208
+
Vips.init();
209
+
Vips.disableOperationCache();
210
+
```
211
+
212
+
### Memory Allocation
213
+
214
+
On glibc-based Linux systems (e.g. Debian, Red Hat), the default memory allocator performs poorly for long-running,
215
+
multithreaded processes with frequent small allocations. Using an alternative allocator like jemalloc can reduce the
216
+
off-heap footprint of the JVM when using libvips.
217
+
218
+
Note that the jemalloc project is going through [some turbulence](https://jasone.github.io/2025/06/12/jemalloc-postmortem/)
219
+
at the moment. Facebook have [forked it](https://github.com/facebook/jemalloc), though its maintenance status is
220
+
currently unknown.
221
+
222
+
An example of using jemalloc on Ubuntu:
223
+
1. Install jemalloc
224
+
```sh
225
+
apt install jemalloc-dev
226
+
```
227
+
2. Set the `LD_PRELOAD` environment variable before running your application.
228
+
```sh
229
+
export LD_PRELOAD=/usr/local/lib/libjemalloc.so
230
+
java -jar ...
231
+
```
232
+
196
233
## Project goals
197
234
198
235
Ideas and suggestions are welcome, but please make sure they fit in to these goals, or you have a good argument about
@@ -224,4 +261,4 @@ Thank you for being enthusiastic about the project!
224
261
* And only after a GitHub Release is made
225
262
* Run `./publish_release_to_maven_central.sh <version matching github release version, including v prefix>`
0 commit comments