RFR: 8305770: os::Linux::available_memory() should refer MemAvailable in /proc/meminfo

Thomas Stuefe stuefe at openjdk.org
Sat Apr 22 06:10:44 UTC 2023


On Sat, 22 Apr 2023 03:28:43 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

> I grep'ed all of usages of `os::available_memory()` for Linux.
> 
>     * Log messages
>       
>       * `os::print_memory_info()`
>       * `CompileBroker::possibly_add_compiler_threads()`
>       * `VM_RedefineClasses::load_new_class_versions()`
>       * `VM_RedefineClasses::redefine_single_class()`
> 
>     * JFR events
>       
>       * `TRACE_REQUEST_FUNC(PhysicalMemory)`
> 
>     * JIT
>       
>       * `CompileBroker::possibly_add_compiler_threads()`
> 
> 
> This change affects JIT behavior only because the return of this function affects number of JIT compiler thread both C1 and C2. However they are limited by `CICompilerCount`, so I think it is not a critical.
> 
> Do you have any other concerns?

The JFR event should maybe changed to report both available and free; but that's a separate issue. The JIT issue is noteworthy and may lead to more compiler threads running; maybe quickly ask on hotspot-compiler.

As I wrote, I think this change makes a lot of sense.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13398#issuecomment-1518526679


More information about the hotspot-runtime-dev mailing list