summaryrefslogtreecommitdiff
path: root/runtime/parsed_options_test.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2019-03-29 22:55:06 -0700
committer Hans Boehm <hboehm@google.com> 2019-04-20 00:52:14 +0000
commitbb2467b398481a15ddb0b65cfcf3c15ff3cb0b8d (patch)
tree1fb58f57d31e0adb6e5b3170a45de16d3e5179f0 /runtime/parsed_options_test.cc
parent7c887c57b1b32b9432c74582ab9a4be43a280ee9 (diff)
Make kHugeNativeAllocs configurable
Add -XX:StopForNativeAllocs command line argument to replace kHugeNativeAllocs constant. The default remains at 1 GB. But This default will allow small memory devices to run out of memory if we allocate Java owned native memory faster than what the GC can keep up with. Setting it to a smaller value should prevent that. Bug: 122552730 Test: Boot AOSP, Treehugger Change-Id: I5c84b2f1f67038e1b7a0ca3f5fc08090359c5f3e
Diffstat (limited to 'runtime/parsed_options_test.cc')
-rw-r--r--runtime/parsed_options_test.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/parsed_options_test.cc b/runtime/parsed_options_test.cc
index ca2a4ea32e..75952bbc66 100644
--- a/runtime/parsed_options_test.cc
+++ b/runtime/parsed_options_test.cc
@@ -64,6 +64,7 @@ TEST_F(ParsedOptionsTest, ParsedOptions) {
options.push_back(std::make_pair("-Xmx4k", nullptr));
options.push_back(std::make_pair("-Xss1m", nullptr));
options.push_back(std::make_pair("-XX:HeapTargetUtilization=0.75", nullptr));
+ options.push_back(std::make_pair("-XX:StopForNativeAllocs=200m", nullptr));
options.push_back(std::make_pair("-Dfoo=bar", nullptr));
options.push_back(std::make_pair("-Dbaz=qux", nullptr));
options.push_back(std::make_pair("-verbose:gc,class,jni", nullptr));
@@ -90,6 +91,7 @@ TEST_F(ParsedOptionsTest, ParsedOptions) {
EXPECT_PARSED_EQ(2048U, Opt::MemoryInitialSize);
EXPECT_PARSED_EQ(4 * KB, Opt::MemoryMaximumSize);
EXPECT_PARSED_EQ(1 * MB, Opt::StackSize);
+ EXPECT_PARSED_EQ(200 * MB, Opt::StopForNativeAllocs);
EXPECT_DOUBLE_EQ(0.75, map.GetOrDefault(Opt::HeapTargetUtilization));
EXPECT_TRUE(test_vfprintf == map.GetOrDefault(Opt::HookVfprintf));
EXPECT_TRUE(test_exit == map.GetOrDefault(Opt::HookExit));