Skip to content

v1.4.1 — a memory budget of its own

Choose a tag to compare

@phaller222 phaller222 released this 23 Aug 19:28
· 19 commits to main since this release

A self-hosting fix. No API change — nothing under src/ differs from 1.4.0 and docs/openapi.json differs in exactly one line (info.version), so the four published client libraries stay valid on 1.4.0 and need no regeneration.

The container now has a memory budget of its own

Nothing set a memory limit on the app container. The JVM is container-aware, so it sizes its heap from the container's limit — but with no limit it falls back to a share of the host's RAM. Measured on a 32 GB machine: a maximum heap of 8.4 GB, for a stack meant to run on a home server. Idle usage of ~657 MB was never a requirement, only the point it happened to stop at.

  • docker-compose.yaml sets mem_limit (1 GB, override with MEM_LIMIT in .env)
  • the image sets -XX:MaxRAMPercentage=60, not a fixed -Xmx — a fixed value is wrong in both directions, OOM-killed on a small host and wasteful on a large one
  • the README's single-container command carries -m 1g, and says why

60% rather than the customary 75%: this application's non-heap footprint — metaspace, code cache, threads, natives — measures around 310 MiB. At a 1 GB limit, 75% would put the heap ceiling past the limit, so a heap that genuinely filled up would be OOM-killed instead of collected. If you want 75%, give the container 2 GB:

docker run -m 2g -e JDK_JAVA_OPTIONS="-XX:MaxRAMPercentage=75" -p 8080:8080 prioritize

What to expect

At a 1 GB limit: about 455 MB idle, 544 MB after a few hundred API calls, starting in around 30 seconds. The PostgreSQL container adds roughly 65 MB. It does fit in 512 MB, but at ~92% of the limit there is no headroom.

Full changelog: v1.4.0...v1.4.1