scgkiran commented on PR #13045: URL: https://github.com/apache/gluten/pull/13045#issuecomment-5928642666
> Example of the failure: > > * Stage 0 runs with 2 concurrent tasks (~2 GB peak each); JVM commits ~8.9 GB of a 9 GB heap > * Stage 0 finishes; actual heap usage drops to ~2 GB, but totalMemory() remains ~8.9 GB because the JVM has not yet returned the committed pages to the OS > * Stage 1 starts and requests 8 MB: 8 MB + 0 + 8.9 GB >= 9 GB → OOM triggered > * Actual free heap was ~6.5 GB (freeMemory()); the allocation should have succeeded > In the above example, at stage1, 8MB request should trigger a GC synchronously before OOM is triggered. Isn't it? [`borrow`](https://github.com/apache/gluten/blob/5d35d9ec26e53bef2c90f950dd2ecc299d87e641/gluten-core/src/main/java/org/apache/gluten/memory/memtarget/DynamicOffHeapSizingMemoryTarget.java#L187) -> shrinkOnHeapMemory --> [shrinkOnHeapMemoryInternal](https://github.com/apache/gluten/blob/5d35d9ec26e53bef2c90f950dd2ecc299d87e641/gluten-core/src/main/java/org/apache/gluten/memory/memtarget/DynamicOffHeapSizingMemoryTarget.java#L345) --> System.gc(); After this totalMemory() should come down. What am I missing? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
