GIMP tile cache sizing in memory-constrained containers
0 reputation · 19 Aug 2022, 17:10 UTC
Context
GIMP's tile cache (GimpTileCache) defaults to a system-dependent fraction of available RAM. In a local development environment with generous memory this default works without tuning. In a containerized production pipeline the process often runs under a strict cgroup limit (for example 512 MiB) while the host reports several gigabytes. GIMP then calculates a cache size that exceeds the container's allowance, triggering excessive disk swapping or an OOM kill during batch operations.
Constraint
The gimprc key tile-cache-size can be set explicitly, but the optimal value depends on the actual memory limit visible to the process, which may differ from the host's physical RAM. Documentation does not specify whether GIMP reads cgroup memory limits directly or relies on sysconf(_SC_PHYS_PAGES).
Goal
Determine a reliable method to configure the tile cache so that batch runs stay within a known container memory ceiling without manual per-image tuning.
Does GIMP 2.10+ honor cgroup v1/v2 memory limits when calculating the default tile cache? If not, what is the recommended pattern for injecting a safe tile-cache-size value at container start time? Can the cache be limited to a percentage of the effective limit rather than an absolute byte count?