You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by nn...@apache.org on 2014/01/13 22:54:23 UTC

[2/2] git commit: Updated slave to use new memory struct.

Updated slave to use new memory struct.

>From #16769, memory() now returns both total _and_ free system memory.
This patch adjusts for the new return type.

Review: https://reviews.apache.org/r/16771


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6d943bb4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6d943bb4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6d943bb4

Branch: refs/heads/master
Commit: 6d943bb45dbff3b2a4acf51e9b5453fb35887704
Parents: d4c57ce
Author: Niklas Q. Nielsen <ni...@mesosphere.io>
Authored: Mon Jan 13 21:40:08 2014 +0000
Committer: Niklas Q. Nielsen <ni...@mesosphere.io>
Committed: Mon Jan 13 21:40:08 2014 +0000

----------------------------------------------------------------------
 src/slave/slave.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6d943bb4/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 396293b..57d58b3 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -147,14 +147,14 @@ void Slave::initialize()
   if (!resources.mem().isSome()) {
     Bytes mem;
 
-    Try<Bytes> mem_ = os::memory();
+    Try<os::Memory> mem_ = os::memory();
     if (!mem_.isSome()) {
       LOG(WARNING) << "Failed to auto-detect the size of main memory: '"
                    << mem_.error()
                    << "' ; defaulting to " << DEFAULT_MEM;
       mem = DEFAULT_MEM;
     } else {
-      mem = mem_.get();
+      mem = mem_.get().total;
 
       // Leave 1 GB free if we have more than 1 GB, otherwise, use all!
       // TODO(benh): Have better default scheme (e.g., % of mem not