Mercurial > hg > thermostat-ng > agent
changeset 2768:13f7923af927
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
author | Simon Tooke <stooke@redhat.com> |
---|---|
date | Thu, 05 Oct 2017 10:35:02 -0400 |
parents | 30a68cb57107 |
children | 6dbace3c1515 |
files | common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsHelperImpl.java common/portability/src/main/java/com/redhat/thermostat/common/portability/internal/windows/WindowsPortableProcessImpl.java |
diffstat | 2 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
--- 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); } }