I think it’s FOP that causes this. It sometimes runs out of memory while enumerating system fonts, presumably because there are quite a lot of them.
There doesn’t appear to be any way to tell it to only use specific fonts without hard-coding the path. Putting
<auto-detect/> in the FOP config file seems to be the only way to get it to look in the system font directories (see https://xmlgraphics.apache.org/fop/2.1/fonts.html).
librsvg— bleh. It also makes things less self-contained, although it isn’t really with the fonts already anyway. (See https://github.com/mkowsiak/jnicookbook.)
In the meantime, I guess watch out for the
java_pidXXXXX.hprof files and delete them when they appear.