Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
/ jdk22u Public archive

Commit 83ff84a

Browse files
committed
8324637: [aix] Implement support for reporting swap space in jdk.management
Backport-of: 33324a59ccdb220250cb74e15ce13af0e99dcb07
1 parent 6e426ec commit 83ff84a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/jdk.management/unix/native/libmanagement_ext/OperatingSystemImpl.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -105,6 +105,12 @@ static jlong get_total_or_available_swap_space_size(JNIEnv* env, jboolean availa
105105
throw_internal_error(env, "sysctlbyname failed");
106106
}
107107
return available ? (jlong)vmusage.xsu_avail : (jlong)vmusage.xsu_total;
108+
#elif defined(_AIX)
109+
perfstat_memory_total_t memory_info;
110+
if (perfstat_memory_total(NULL, &memory_info, sizeof(perfstat_memory_total_t), 1) == -1) {
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);
108114
#else /* _ALLBSD_SOURCE */
109115
/*
110116
* XXXBSD: there's no way available to get swap info in

0 commit comments

Comments
 (0)