wmic process where processid=<pid> get WorkingSetSize returns a value in bytes

This commit is contained in:
Peter Palaga
2020-10-23 23:09:44 +02:00
parent a11a9fb31f
commit 02eed95132
2 changed files with 2 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ public class OsUtils {
final List<String> nonEmptyLines = output.stream().filter(l -> !l.isEmpty()).collect(Collectors.toList());
if (nonEmptyLines.size() >= 2) {
try {
return Long.parseLong(nonEmptyLines.get(1).trim());
return Long.parseLong(nonEmptyLines.get(1).trim()) / KB;
} catch (NumberFormatException e) {
LOGGER.warn("Could not parse the second line of " + Stream.of(cmd).collect(Collectors.joining(" "))
+ " output as a long:\n"