You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2014/05/20 16:15:46 UTC
svn commit: r1596262 - in /uima/sandbox/uima-ducc/trunk:
uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeMemInfoCollector.java
uima-ducc-common/src/main/java/org/apache/uima/ducc/common/node/metrics/NodeMemoryInfo.java
Author: cwiklik
Date: Tue May 20 14:15:46 2014
New Revision: 1596262
URL: http://svn.apache.org/r1596262
Log:
UIMA-3832 dont adjust free memory when running agent in simulation mode
Modified:
uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeMemInfoCollector.java
uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/node/metrics/NodeMemoryInfo.java
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeMemInfoCollector.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeMemInfoCollector.java?rev=1596262&r1=1596261&r2=1596262&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeMemInfoCollector.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/metrics/collectors/NodeMemInfoCollector.java Tue May 20 14:15:46 2014
@@ -95,9 +95,14 @@ public class NodeMemInfoCollector implem
} finally {
fileReader.close();
}
- // sum up memory of all processes owned by UIDs < gidMax
- long memUsed = collectRSSFromPSCommand();
- //System.out.println("Total:"+memInfoValues[0] + " Available:"+memInfoValues[1] +" Calculated:"+(memInfoValues[0] - memUsed)+" Priviledged Memory:"+memUsed);
+ long memUsed = 0;
+ // if running ducc in simulation mode skip memory adjustment. Report free memory = fakeMemorySize
+ if ( fakeMemorySize > -1 ) {
+ // sum up memory of all processes owned by UIDs < gidMax
+ memUsed = collectRSSFromPSCommand();
+ //System.out.println("Total:"+memInfoValues[0] + " Available:"+memInfoValues[1] +" Calculated:"+(memInfoValues[0] - memUsed)+" Priviledged Memory:"+memUsed);
+ }
+
memInfoValues[1] = memInfoValues[0] - memUsed;
return new NodeMemoryInfo(memInfoValues, fakeMemorySize);
}
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/node/metrics/NodeMemoryInfo.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/node/metrics/NodeMemoryInfo.java?rev=1596262&r1=1596261&r2=1596262&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/node/metrics/NodeMemoryInfo.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-common/src/main/java/org/apache/uima/ducc/common/node/metrics/NodeMemoryInfo.java Tue May 20 14:15:46 2014
@@ -45,6 +45,9 @@ implements NodeMemory {
return memInfoValues[0];
}
public long getMemFree() {
+ if ( memTotal > 0 ) { // this should be true only for testing
+ return memTotal;
+ }
return memInfoValues[1];
}
public long getBuffers() {