Skip to content

Commit

Permalink
Add a Finch experiment V8HugeMaxOldGenerationSizefor V8 heap size inc…
Browse files Browse the repository at this point in the history
…rease

Increase max_old_space_size to 4 GB based on availability of physical memory.
The purpose of this finch is to support web apps that require more heap space
for their data sets

Bug:958974

Change-Id: I7f6bb9e69a306331242434cfc03acd68ad32333d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1592792
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656851}
  • Loading branch information
Maggie Chen authored and Commit Bot committed May 6, 2019
1 parent d4f6d8b commit 2397118
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gin/gin_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ const base::Feature kV8FlushBytecode{"V8FlushBytecode",
const base::Feature kV8MemoryReducerForSmallHeaps{
"V8MemoryReducerForSmallHeaps", base::FEATURE_ENABLED_BY_DEFAULT};

// Increase V8 heap size to 4GB if the physical memory is bigger than 16 GB.
const base::Feature kV8HugeMaxOldGenerationSize{
"V8HugeMaxOldGenerationSize", base::FEATURE_DISABLED_BY_DEFAULT};

} // namespace features
1 change: 1 addition & 0 deletions gin/gin_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace features {
GIN_EXPORT extern const base::Feature kV8OptimizeJavascript;
GIN_EXPORT extern const base::Feature kV8FlushBytecode;
GIN_EXPORT extern const base::Feature kV8MemoryReducerForSmallHeaps;
GIN_EXPORT extern const base::Feature kV8HugeMaxOldGenerationSize;

} // namespace features

Expand Down
7 changes: 7 additions & 0 deletions gin/v8_initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
sizeof(no_memory_reducer) - 1);
}

if (base::FeatureList::IsEnabled(features::kV8HugeMaxOldGenerationSize)) {
static const char huge_max_old_generation_size[] =
"--huge_max_old_generation_size";
v8::V8::SetFlagsFromString(huge_max_old_generation_size,
sizeof(huge_max_old_generation_size) - 1);
}

if (IsolateHolder::kStrictMode == mode) {
static const char use_strict[] = "--use_strict";
v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);
Expand Down
19 changes: 19 additions & 0 deletions testing/variations/fieldtrial_testing_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5443,6 +5443,25 @@
]
}
],
"V8HugeMaxOldGenerationSize": [
{
"platforms": [
"android",
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"V8HugeMaxOldGenerationSize"
]
}
]
}
],
"V8Ignition": [
{
"platforms": [
Expand Down

0 comments on commit 2397118

Please sign in to comment.