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

Issue 2289123003: Fixing OOM crash in base::ProcessMetrics::GetWorkingSetKBytes (Closed)

Created:
4 years, 3 months ago by stanisc
Modified:
4 years, 3 months ago
Reviewers:
Lei Zhang, brucedawson
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixing OOM crash in base::ProcessMetrics::GetWorkingSetKBytes According to crash dump OOM happens when GetWorkingSetKBytes is invoked via OomMemoryDetails from tab discarding code when it reacts to critical memory pressure. The available memory is already low at that moment so allocating 1.4-1.5 MiB to gather Working Set details is likely to fail. The fix uses UncheckedMalloc to avoid triggering an OOM crash and allow GetWorkingSetKBytes to fail, which the code calling GetWorkingSetKBytes should already handle. Another part of the fix is to reduce the extra buffer size allocated by this code from 25% to 10%. BUG=642186 Committed: https://crrev.com/75ab2123b5c63d30ae6f7bf8efac15ca857653f1 Cr-Commit-Position: refs/heads/master@{#417479}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Switched to UncheckedMalloc to avoid OOM crash #

Total comments: 12

Patch Set 3 : Addressed CR feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -18 lines) Patch
M base/process/process_metrics_win.cc View 1 2 4 chunks +41 lines, -18 lines 0 comments Download

Messages

Total messages: 31 (22 generated)
brucedawson
If the goal is to avoid OOM then maybe what is really wanted is to ...
4 years, 3 months ago (2016-09-07 00:41:12 UTC) #6
stanisc
Including thestig@chromium.org as the code OWNER. PTAL! https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc File base/process/process_metrics_win.cc (right): https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc#newcode189 base/process/process_metrics_win.cc:189: Will remove ...
4 years, 3 months ago (2016-09-07 21:41:05 UTC) #10
brucedawson
lgtm with one important nit. https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc File base/process/process_metrics_win.cc (right): https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc#newcode146 base/process/process_metrics_win.cc:146: class WorkingSetInformationBuffer { Needs ...
4 years, 3 months ago (2016-09-08 20:25:27 UTC) #11
Lei Zhang
lgtm https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc File base/process/process_metrics_win.cc (right): https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc#newcode155 base/process/process_metrics_win.cc:155: return base::UncheckedMalloc(size, &buffer_); You can omit base:: in ...
4 years, 3 months ago (2016-09-08 21:19:57 UTC) #12
stanisc
Addressed CR feedback. https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc File base/process/process_metrics_win.cc (right): https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc#newcode146 base/process/process_metrics_win.cc:146: class WorkingSetInformationBuffer { On 2016/09/08 20:25:27, ...
4 years, 3 months ago (2016-09-08 23:10:15 UTC) #21
Lei Zhang
https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc File base/process/process_metrics_win.cc (right): https://codereview.chromium.org/2289123003/diff/40001/base/process/process_metrics_win.cc#newcode172 base/process/process_metrics_win.cc:172: void* buffer_ = nullptr; On 2016/09/08 23:10:14, stanisc wrote: ...
4 years, 3 months ago (2016-09-08 23:12:48 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2289123003/100001
4 years, 3 months ago (2016-09-09 02:12:18 UTC) #27
commit-bot: I haz the power
Committed patchset #3 (id:100001)
4 years, 3 months ago (2016-09-09 02:21:33 UTC) #29
commit-bot: I haz the power
4 years, 3 months ago (2016-09-09 02:24:03 UTC) #31
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/75ab2123b5c63d30ae6f7bf8efac15ca857653f1
Cr-Commit-Position: refs/heads/master@{#417479}

Powered by Google App Engine
This is Rietveld 408576698