Revision: 17081
Author:   [email protected]
Date:     Wed Oct  2 13:36:38 2013 UTC
Log:      Tweak default max heap size constants for platforms with swap.

Configure platforms with swap memory with larger heap size by default. Also
introduce an additional "bucket" between 1GB-2GBs.

BUG=None
[email protected], [email protected]

Review URL: https://codereview.chromium.org/24978006

Patch from Ross McIlroy <[email protected]>.
http://code.google.com/p/v8/source/detail?r=17081

Modified:
 /branches/bleeding_edge/src/defaults.cc

=======================================
--- /branches/bleeding_edge/src/defaults.cc     Fri Sep 27 10:53:07 2013 UTC
+++ /branches/bleeding_edge/src/defaults.cc     Wed Oct  2 13:36:38 2013 UTC
@@ -33,6 +33,14 @@

 namespace v8 {

+
+#if V8_OS_ANDROID
+const bool kOsHasSwap = false;
+#else
+const bool kOsHasSwap = true;
+#endif
+
+
 bool ConfigureResourceConstraintsForCurrentPlatform(
     ResourceConstraints* constraints) {
   if (constraints == NULL) {
@@ -44,18 +52,22 @@

// The young_space_size should be a power of 2 and old_generation_size should
   // be a multiple of Page::kPageSize.
-  if (physical_memory > 2ul * i::GB) {
+  if (physical_memory <= 512ul * i::MB) {
+    constraints->set_max_young_space_size(2 * lump_of_memory);
+    constraints->set_max_old_space_size(128 * lump_of_memory);
+    constraints->set_max_executable_size(96 * lump_of_memory);
+ } else if (physical_memory <= (kOsHasSwap ? 768ul * i::MB : 1ul * i::GB)) {
+    constraints->set_max_young_space_size(8 * lump_of_memory);
+    constraints->set_max_old_space_size(256 * lump_of_memory);
+    constraints->set_max_executable_size(192 * lump_of_memory);
+  } else if (physical_memory <= (kOsHasSwap ? 1ul * i::GB : 2ul * i::GB)) {
+    constraints->set_max_young_space_size(16 * lump_of_memory);
+    constraints->set_max_old_space_size(512 * lump_of_memory);
+    constraints->set_max_executable_size(256 * lump_of_memory);
+  } else {
     constraints->set_max_young_space_size(16 * lump_of_memory);
     constraints->set_max_old_space_size(700 * lump_of_memory);
     constraints->set_max_executable_size(256 * lump_of_memory);
-  } else if (physical_memory > 512ul * i::MB) {
-    constraints->set_max_young_space_size(8 * lump_of_memory);
-    constraints->set_max_old_space_size(192 * lump_of_memory);
-    constraints->set_max_executable_size(192 * lump_of_memory);
-  } else /* (physical_memory <= 512GB) */ {
-    constraints->set_max_young_space_size(2 * lump_of_memory);
-    constraints->set_max_old_space_size(96 * lump_of_memory);
-    constraints->set_max_executable_size(96 * lump_of_memory);
   }
   return true;
 }
@@ -68,4 +80,4 @@
   return SetResourceConstraints(&constraints);
 }

-}  // namespace v8::internal
+}  // namespace v8

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to