# HG changeset patch # User Simon Tooke # Date 1507214102 14400 # Node ID 13f7923af927a87d081b40a02defce5e3a808deb # Parent 30a68cb571071b4fe78ca8bde354a1a27ed4d062 Implement resident memory size for Window This patch enables the Windows side of the recent resident memory patch Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025268.html diff -r 30a68cb57107 -r 13f7923af927 common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java --- a/common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java Wed Oct 04 15:08:14 2017 -0400 +++ b/common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java Thu Oct 05 10:35:02 2017 -0400 @@ -244,10 +244,15 @@ return info; } - long[] getProcessMemInfo(int pid) { + /** + * get process info + * @param pid process id + * @return long WorkingSetSize + */ + long getProcessWorkingSetSize(int pid) { final long[] info = new long[5]; getProcessInfo0(pid, info); - return info; + return info[0]; } long[] getProcessIOInfo(int pid) { diff -r 30a68cb57107 -r 13f7923af927 common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsPortableProcessImpl.java --- a/common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsPortableProcessImpl.java Wed Oct 04 15:08:14 2017 -0400 +++ b/common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsPortableProcessImpl.java Thu Oct 05 10:35:02 2017 -0400 @@ -120,11 +120,6 @@ @Override public Long getResidentMemorySize(int pid) { - try { - throw new UnimplementedError("getResidentMemorySize()"); - } catch (UnimplementedError e) { - LOGGER.log(Level.WARNING, "getResidentMemorySize() is not available for Windows at this moment"); - return null; - } + return helper.getProcessWorkingSetSize(pid); } }