Commit 8621cf2a authored by Alex Gough's avatar Alex Gough Committed by Commit Bot

Reduce space reserved for sandbox policy.

Metrics indicate that even outliers do not require more than two pages
(8k).  This change conservatively reduces the reserved size to six
pages.

A follow-on CL will remove the plumbing used to collect the metric.

Tests: existing sandbox and chrome tests.
Bug: 1059129
Change-Id: Id5c95cb5d3bf0e1b500732cf65927a7053d2856b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225256Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773900}
parent 71db163d
......@@ -46,7 +46,8 @@ enum TestId {
// Helper function to allocate space (on the heap) for policy.
PolicyGlobal* MakePolicyMemory() {
const size_t kTotalPolicySz = 4096 * 8;
// Should not exceed kPolMemSize from |sandbox_policy_base.cc|.
const size_t kTotalPolicySz = 4096 * 6;
char* mem = new char[kTotalPolicySz];
memset(mem, 0, kTotalPolicySz);
PolicyGlobal* policy = reinterpret_cast<PolicyGlobal*>(mem);
......
......@@ -44,7 +44,7 @@ namespace {
constexpr size_t kOneMemPage = 4096;
// The IPC and Policy shared memory sizes.
constexpr size_t kIPCMemSize = kOneMemPage * 2;
constexpr size_t kPolMemSize = kOneMemPage * 14;
constexpr size_t kPolMemSize = kOneMemPage * 6;
// Helper function to allocate space (on the heap) for policy.
sandbox::PolicyGlobal* MakeBrokerPolicyMemory() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment