On Thu, 25 Jan 2024 12:30:15 GMT, Matthias Baesken <mbaes...@openjdk.org> wrote:

> The get_total_or_available_swap_space_size coding misses AIX support, we only 
> return 0. This should be enhanced.
> The perfstat API can be used, see 
> https://www.ibm.com/docs/pt/aix/7.2?topic=interfaces-perfstat-memory-total-interface
>  .

Small nit, otherwise good.

src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c line 113:

> 111:         throw_internal_error(env, "perfstat_memory_total failed");
> 112:     }
> 113:     return available ? (jlong)(memory_info.pgsp_free * 4L * 1024L) : 
> (jlong)(memory_info.pgsp_total * 4L * 1024L);

Do we need the cast? perfstat_memory_total_t members are all 64-bit, no?

Also, can we shorten this to:


return (available ? memory_info.pgsp_free : memory_info.pgsp_total) * 4096;

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17569#pullrequestreview-1843868729
PR Review Comment: https://git.openjdk.org/jdk/pull/17569#discussion_r1466454083

Reply via email to