xumanbu opened a new issue, #12479:
URL: https://github.com/apache/gluten/issues/12479

   ### Description
   
   ### Description
   `DynamicOffHeapSizingMemoryTarget` relies on JVM heap shrinking (returning 
committed heap pages to the OS) to reclaim memory for off-heap usage. The 
static initializer already checks for `-XX:+ExplicitGCInvokesConcurrent` and 
`-XX:+DisableExplicitGC`, which would prevent shrinking from working.
   However, it misses the case where `-Xms == -Xmx` (or nearly equal). When the 
heap size is fixed, `Runtime.getRuntime().totalMemory()` is always equal to 
`maxMemory()`, meaning `System.gc()` can free objects but cannot shrink the 
committed heap. The `shrinkOnHeapMemory` mechanism becomes ineffective in this 
scenario.
   ### Expected Behavior
   The static initializer should detect when the initial committed heap is 
already at (or very close to) max heap size, and log an error indicating that 
JVM shrinking will not work.
   ### Environment
   All JDK versions with dynamic off-heap sizing enabled.
   
   ### Gluten version
   
   main branch


-- 
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]

Reply via email to