Skip to content

Commit

Permalink
8324637: [aix] Implement support for reporting swap space in jdk.mana…
Browse files Browse the repository at this point in the history
…gement

Backport-of: 33324a59ccdb220250cb74e15ce13af0e99dcb07
  • Loading branch information
MBaesken committed Feb 8, 2024
1 parent d08f24a commit bed2eaa
Showing 1 changed file with 7 additions and 1 deletion.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -105,6 +105,12 @@ static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean availa
throw_internal_error(env, "sysctlbyname failed");
}
return available ? (jlong)vmusage.xsu_avail : (jlong)vmusage.xsu_total;
#elif defined(_AIX)
perfstat_memory_total_t memory_info;
if (perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1) == -1) {
throw_internal_error(env, "perfstat_memory_total failed");
}
return available ? (jlong)(memory_info.pgsp_free * 4L * 1024L) : (jlong)(memory_info.pgsp_total * 4L * 1024L);
#else /* _ALLBSD_SOURCE */
/*
* XXXBSD: there's no way available to get swap info in
Expand Down

1 comment on commit bed2eaa

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.