Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: src/defaults.cc

Issue 24978006: Tweak default max heap size constants for platforms with swap. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix comment typo Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/defaults.cc
diff --git a/src/defaults.cc b/src/defaults.cc
index 301155f94dcb24f758eecf7f2d113ab026853381..eb9e0deab0f3211798504b1c7ccc4a7e27d031fc 100644
--- a/src/defaults.cc
+++ b/src/defaults.cc
@@ -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 @@ bool ConfigureResourceConstraintsForCurrentPlatform(
// 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) {
Hannes Payer (out of office) 2013/10/02 12:59:17 This change will increase the maximum used heap si
rmcilroy 2013/10/02 13:05:56 Yes, this is intended.
+ 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);
Hannes Payer (out of office) 2013/10/02 12:59:17 Same here.
rmcilroy 2013/10/02 13:05:56 Also intended. Thanks for checking!
+ 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 @@ bool SetDefaultResourceConstraintsForCurrentPlatform() {
return SetResourceConstraints(&constraints);
}
-} // namespace v8::internal
+} // namespace v8
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698