1
2
3
4
5 package oshi.driver.unix.aix.perfstat;
6
7 import com.sun.jna.platform.unix.aix.Perfstat;
8 import com.sun.jna.platform.unix.aix.Perfstat.perfstat_memory_total_t;
9
10 import oshi.annotation.concurrent.ThreadSafe;
11
12
13
14
15 @ThreadSafe
16 public final class PerfstatMemory {
17
18 private static final Perfstat PERF = Perfstat.INSTANCE;
19
20 private PerfstatMemory() {
21 }
22
23
24
25
26
27
28 public static perfstat_memory_total_t queryMemoryTotal() {
29 perfstat_memory_total_t memory = new perfstat_memory_total_t();
30 int ret = PERF.perfstat_memory_total(null, memory, memory.size(), 1);
31 if (ret > 0) {
32 return memory;
33 }
34 return new perfstat_memory_total_t();
35 }
36 }