You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "scgkiran (via GitHub)" <gi...@apache.org> on 2026/10/01 09:29:04 UTC
Re: [PR] [GLUTEN-13044][CORE] Fix exceedsMaxMemoryUsage to use actual used heap instead of committed heap [gluten]
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org