What problem does it solve?
Arrow "Memory was leaked" errors report the close-time detection stack rather than the actual allocation site, making leaks hard to trace. This Skill explains how to enable Arrow's debug allocator in XTDB's Gradle build, identify the failure-path cleanup gaps that cause most leaks, and avoid misattribution from property-test shrinking.
Core Features & Use Cases
- Debug Allocator Setup: Explains why
-D flags and JAVA_TOOL_OPTIONS fail, and how to flip arrow.memory.debug.allocator in build.gradle.kts defaultJvmArgs to capture allocation stack traces.
- Leak Pattern Recognition: Identifies common XTDB leak causes such as
openSlice results handed off without .use or closeOnCatch on throwing code paths.
- Property-Test Guidance: Shows how to bisect leaks across commits at high
-Piterations and confirm single-op reproductions with a plain deftest, avoiding the shrinker's misleading :smallest case.
- Use Case: A CI test run reports leaked Arrow memory naming the
leader-log-processor allocator; use this Skill to enable the debug allocator, locate the orphaned buffer in the transaction indexing path, and write a minimal reproducing test.
Quick Start
Ask the assistant to help track down the Arrow memory leak reported by your failing XTDB test, starting by enabling the debug allocator in build.gradle.kts.