flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject git commit: Fix buggy computation of TaskManager free memory size
Date Fri, 27 Jun 2014 15:42:14 GMT
Repository: incubator-flink
Updated Branches:
  refs/heads/master f4d522b7b -> 9ce629307


Fix buggy computation of TaskManager free memory size

- In NepheleMiniCluster the memory size was divided twice by the number of TaskManagers
- In HardwareDescriptionFactory the memory fraction config value was multiplied too early


Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/9ce62930
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/9ce62930
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/9ce62930

Branch: refs/heads/master
Commit: 9ce6293075d1a2326df8a2e99c032445a555b28b
Parents: f4d522b
Author: uce <u.celebi@fu-berlin.de>
Authored: Fri Jun 27 17:38:53 2014 +0200
Committer: uce <u.celebi@fu-berlin.de>
Committed: Fri Jun 27 17:38:53 2014 +0200

----------------------------------------------------------------------
 .../client/minicluster/NepheleMiniCluster.java          |  2 +-
 .../nephele/instance/HardwareDescription.java           |  2 --
 .../nephele/instance/HardwareDescriptionFactory.java    | 12 +++---------
 3 files changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/9ce62930/stratosphere-clients/src/main/java/eu/stratosphere/client/minicluster/NepheleMiniCluster.java
----------------------------------------------------------------------
diff --git a/stratosphere-clients/src/main/java/eu/stratosphere/client/minicluster/NepheleMiniCluster.java
b/stratosphere-clients/src/main/java/eu/stratosphere/client/minicluster/NepheleMiniCluster.java
index 4daca26..86a6efa 100644
--- a/stratosphere-clients/src/main/java/eu/stratosphere/client/minicluster/NepheleMiniCluster.java
+++ b/stratosphere-clients/src/main/java/eu/stratosphere/client/minicluster/NepheleMiniCluster.java
@@ -290,7 +290,7 @@ public class NepheleMiniCluster {
 
 		memorySize /= numTaskManager;
 
-		config.setLong(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, memorySize/numTaskManager);
+		config.setLong(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, memorySize);
 
 		config.setInteger(ConfigConstants.LOCAL_INSTANCE_MANAGER_NUMBER_TASK_MANAGER, numTaskManager);
 

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/9ce62930/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescription.java
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescription.java
b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescription.java
index f79c6b3..83d650a 100644
--- a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescription.java
+++ b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescription.java
@@ -67,7 +67,6 @@ public final class HardwareDescription implements IOReadableWritable {
 		this.sizeOfFreeMemory = sizeOfFreeMemory;
 	}
 
-
 	@Override
 	public void write(final DataOutput out) throws IOException {
 
@@ -76,7 +75,6 @@ public final class HardwareDescription implements IOReadableWritable {
 		out.writeLong(this.sizeOfFreeMemory);
 	}
 
-
 	@Override
 	public void read(final DataInput in) throws IOException {
 

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/9ce62930/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java
----------------------------------------------------------------------
diff --git a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java
b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java
index bf70e49..955c0c9 100644
--- a/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java
+++ b/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/HardwareDescriptionFactory.java
@@ -102,16 +102,10 @@ public class HardwareDescriptionFactory {
 	 *         determined
 	 */
 	private static long getSizeOfFreeMemory() {
-		float fractionToUse = GlobalConfiguration.getFloat(
-			ConfigConstants.TASK_MANAGER_MEMORY_FRACTION_KEY, ConfigConstants.DEFAULT_MEMORY_MANAGER_MEMORY_FRACTION);
-		
 		Runtime r = Runtime.getRuntime();
-		long max = r.maxMemory();
-		long total = r.totalMemory();
-		long free = r.freeMemory();
-		
-		long available = max - total + free;
-		return (long) (fractionToUse * available);
+		long available = r.maxMemory() - r.totalMemory() + r.freeMemory();
+
+		return available;
 	}
 
 	/**


Mime
View raw message