Unexpected heap growth during sustained write transactions despite stable page cache usage
0 reputation · 11 Feb 2022, 00:33 UTC
The goal is to understand why Neo4j exhibits a steady increase in on‑heap memory while the off‑heap page cache size stays constant during sustained write‑heavy transactions. The environment uses the default dbms.memory.pagecache.size setting (≈50 % of RAM) and exposes JMX metrics such as neo4j.memory.heap.used and neo4j.pagecache.memory.used for observation. Public documentation does not detail how the page cache eviction algorithm treats dirty pages belonging to long‑running, uncommitted transactions, leaving the precise interaction unclear. This uncertainty makes it difficult to predict whether heap growth is a side‑effect of retained transaction state or of delayed page cache eviction.
What eviction policy does Neo4j apply to dirty pages generated by long‑running writes? Does the page cache retain those pages longer than clean pages, causing heap pressure? Are there configurable thresholds or monitoring hooks that can force earlier eviction of dirty pages?