Better memory info parse patterns, so that only lines with memory slots are parsed and others (like VmFlags) are ignored
This commit is contained in:
parent
54dc6b7d72
commit
6a5196003b
|
@ -112,7 +112,7 @@ public class ProcfsBasedProcessTree extends ResourceCalculatorProcessTree {
|
||||||
private static final Pattern ADDRESS_PATTERN = Pattern
|
private static final Pattern ADDRESS_PATTERN = Pattern
|
||||||
.compile("([[a-f]|(0-9)]*)-([[a-f]|(0-9)]*)(\\s)*([rxwps\\-]*)");
|
.compile("([[a-f]|(0-9)]*)-([[a-f]|(0-9)]*)(\\s)*([rxwps\\-]*)");
|
||||||
private static final Pattern MEM_INFO_PATTERN = Pattern
|
private static final Pattern MEM_INFO_PATTERN = Pattern
|
||||||
.compile("(^[A-Z].*):[\\s ]*(.*)");
|
.compile("(^[A-Z].*):[\\s ]*([0-9]*)[\\s ]*kB.*");
|
||||||
|
|
||||||
private boolean smapsEnabled;
|
private boolean smapsEnabled;
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ public class ProcfsBasedProcessTree extends ResourceCalculatorProcessTree {
|
||||||
Matcher memInfo = MEM_INFO_PATTERN.matcher(line);
|
Matcher memInfo = MEM_INFO_PATTERN.matcher(line);
|
||||||
if (memInfo.find()) {
|
if (memInfo.find()) {
|
||||||
String key = memInfo.group(1).trim();
|
String key = memInfo.group(1).trim();
|
||||||
String value = memInfo.group(2).replace(KB, "").trim();
|
String value = memInfo.group(2).trim();
|
||||||
LOG.debug("MemInfo : {} : Value : {}", key, value);
|
LOG.debug("MemInfo : {} : Value : {}", key, value);
|
||||||
|
|
||||||
if (memoryMappingInfo != null) {
|
if (memoryMappingInfo != null) {
|
||||||
|
|
Loading…
Reference in New Issue