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

Issue 1472763003: Reland of: components/metrics: Add runtime memory leak detector (Closed)

Created:
5 years ago by Simon Que
Modified:
5 years ago
CC:
asvitkine+watch_chromium.org, chromium-reviews, Nico
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland of: components/metrics: Add runtime memory leak detector Reverted because it was failing some buildbots. The fixes have been squashed into this one but they can be seen here as separate patches. http://crrev.com/1468873002 http://crrev.com/1471623003 ==== Original commit message ==== This patch adds heuristic-based memory leak detector. Unlike traditional leak detectors like valgrind, it doesn't wait until a process terminates to check for leftover allocations. Instead, it analyzes allocation patterns over time. This code is not thread-safe. It is up to the caller of this code to ensure thread safety. BUG=382705 Signed-off-by: Simon Que <sque@chromium.org>; Committed: https://crrev.com/096af097febf8a07d1323593e8cf94e83467ba71 Cr-Commit-Position: refs/heads/master@{#363836}

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Update temp vector initialization with expected capacity #

Patch Set 4 : Add missing dependency of unit tests on //base to BUILD.gn #

Total comments: 2

Patch Set 5 : Indicate reason for using CustomAllocator #

Patch Set 6 : Use new move semantics #

Total comments: 10

Patch Set 7 : Remove old move macro; Remove uniform initialization syntax #

Total comments: 2

Patch Set 8 : Initialize RankedList::Entry fields together #

Patch Set 9 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3087 lines, -0 lines) Patch
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -0 lines 0 comments Download
M components/metrics.gypi View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
M components/metrics/BUILD.gn View 1 2 3 4 5 3 chunks +49 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/OWNERS View 1 chunk +2 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/call_stack_manager.h View 1 2 3 4 1 chunk +101 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/call_stack_manager.cc View 1 2 3 4 1 chunk +72 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/call_stack_manager_unittest.cc View 1 2 3 4 5 1 chunk +260 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/call_stack_table.h View 1 2 3 4 1 chunk +82 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/call_stack_table.cc View 1 2 3 4 5 1 chunk +80 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/call_stack_table_unittest.cc View 1 chunk +306 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/custom_allocator.h View 1 chunk +50 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/custom_allocator.cc View 1 chunk +61 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_analyzer.h View 1 2 3 4 5 1 chunk +84 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_analyzer.cc View 1 2 3 4 5 1 chunk +139 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_analyzer_unittest.cc View 1 2 3 4 5 1 chunk +364 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector_impl.h View 1 2 3 4 1 chunk +162 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector_impl.cc View 1 2 3 4 5 1 chunk +215 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector_impl_unittest.cc View 1 chunk +464 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector_value_type.h View 1 chunk +52 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/leak_detector_value_type.cc View 1 chunk +47 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/ranked_list.h View 1 2 3 4 5 6 1 chunk +82 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/ranked_list.cc View 1 2 3 4 5 6 7 1 chunk +49 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/ranked_list_unittest.cc View 1 2 3 4 5 1 chunk +268 lines, -0 lines 0 comments Download
A components/metrics/leak_detector/stl_allocator.h View 1 chunk +61 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (21 generated)
Simon Que
The original patch broke some builders and got reverted. I have fixed the two problems. ...
5 years ago (2015-11-23 19:39:00 UTC) #2
jochen (gone - plz use gerrit)
trybots?
5 years ago (2015-11-24 13:02:18 UTC) #3
Simon Que
On 2015/11/24 13:02:18, jochen wrote: > trybots? These two: http://build.chromium.org/p/chromium.lkgr/builders/Win%20x64/builds/1964/steps/compile/logs/stdio https://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%286%29/builds/35526
5 years ago (2015-11-24 19:35:08 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/1
5 years ago (2015-11-24 21:54:54 UTC) #6
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years ago (2015-11-24 21:54:56 UTC) #8
Simon Que
On 2015/11/24 13:02:18, jochen wrote: > trybots? I'm not sure what you meant here. If ...
5 years ago (2015-11-25 05:57:39 UTC) #9
jochen (gone - plz use gerrit)
you should be able to trigger tryjobs using "git cl try"
5 years ago (2015-11-25 08:39:57 UTC) #10
Simon Que
On 2015/11/25 08:39:57, jochen wrote: > you should be able to trigger tryjobs using "git ...
5 years ago (2015-11-26 05:40:46 UTC) #11
jochen (gone - plz use gerrit)
lgtm
5 years ago (2015-11-26 13:21:29 UTC) #12
dcheng
https://codereview.chromium.org/1472763003/diff/60001/components/metrics/leak_detector/call_stack_manager.h File components/metrics/leak_detector/call_stack_manager.h (right): https://codereview.chromium.org/1472763003/diff/60001/components/metrics/leak_detector/call_stack_manager.h#newcode89 components/metrics/leak_detector/call_stack_manager.h:89: base::hash_set<CallStack*, Can we just use std::unique_ptr with a custom ...
5 years ago (2015-11-30 21:05:48 UTC) #14
Simon Que
https://codereview.chromium.org/1472763003/diff/60001/components/metrics/leak_detector/call_stack_manager.h File components/metrics/leak_detector/call_stack_manager.h (right): https://codereview.chromium.org/1472763003/diff/60001/components/metrics/leak_detector/call_stack_manager.h#newcode89 components/metrics/leak_detector/call_stack_manager.h:89: base::hash_set<CallStack*, On 2015/11/30 21:05:48, dcheng wrote: > Can we ...
5 years ago (2015-11-30 22:10:41 UTC) #15
dcheng
On 2015/11/30 at 22:10:41, sque wrote: > https://codereview.chromium.org/1472763003/diff/60001/components/metrics/leak_detector/call_stack_manager.h > File components/metrics/leak_detector/call_stack_manager.h (right): > > https://codereview.chromium.org/1472763003/diff/60001/components/metrics/leak_detector/call_stack_manager.h#newcode89 ...
5 years ago (2015-11-30 23:10:10 UTC) #16
Simon Que
On 2015/11/30 23:10:10, dcheng wrote: > On 2015/11/30 at 22:10:41, sque wrote: > > > ...
5 years ago (2015-12-01 01:21:52 UTC) #17
Simon Que
On 2015/12/01 01:21:52, Simon Que wrote: > On 2015/11/30 23:10:10, dcheng wrote: > > On ...
5 years ago (2015-12-01 01:23:14 UTC) #18
dcheng
On 2015/12/01 at 01:23:14, sque wrote: > On 2015/12/01 01:21:52, Simon Que wrote: > > ...
5 years ago (2015-12-01 18:55:49 UTC) #20
Will Harris
lgtm
5 years ago (2015-12-01 20:48:51 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/100001
5 years ago (2015-12-01 22:16:10 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/115683)
5 years ago (2015-12-01 22:27:26 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/100001
5 years ago (2015-12-02 00:41:25 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_compile_dbg_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/127689)
5 years ago (2015-12-02 01:53:45 UTC) #30
Simon Que
On 2015/12/02 01:53:45, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years ago (2015-12-02 02:04:02 UTC) #31
Will Harris
looks like this needs a rebase.
5 years ago (2015-12-02 02:12:20 UTC) #32
Simon Que
thakis: Need your input on whether move constructors are allowed in ranked_list.(cc|h). Previously I was ...
5 years ago (2015-12-02 02:32:51 UTC) #33
Simon Que
On 2015/12/02 02:32:51, Simon Que wrote: > thakis: Need your input on whether move constructors ...
5 years ago (2015-12-07 18:58:47 UTC) #35
dcheng
https://codereview.chromium.org/1472763003/diff/140001/components/metrics/leak_detector/ranked_list.cc File components/metrics/leak_detector/ranked_list.cc (right): https://codereview.chromium.org/1472763003/diff/140001/components/metrics/leak_detector/ranked_list.cc#newcode18 components/metrics/leak_detector/ranked_list.cc:18: entries_.swap(other.entries_); entries_(std::move(other.entries_)) to keep the two consistent? https://codereview.chromium.org/1472763003/diff/140001/components/metrics/leak_detector/ranked_list.cc#newcode30 components/metrics/leak_detector/ranked_list.cc:30: ...
5 years ago (2015-12-08 02:04:51 UTC) #36
Simon Que
https://codereview.chromium.org/1472763003/diff/140001/components/metrics/leak_detector/ranked_list.cc File components/metrics/leak_detector/ranked_list.cc (right): https://codereview.chromium.org/1472763003/diff/140001/components/metrics/leak_detector/ranked_list.cc#newcode18 components/metrics/leak_detector/ranked_list.cc:18: entries_.swap(other.entries_); On 2015/12/08 02:04:51, dcheng wrote: > entries_(std::move(other.entries_)) to ...
5 years ago (2015-12-08 02:24:16 UTC) #37
dcheng
lgtm https://codereview.chromium.org/1472763003/diff/160001/components/metrics/leak_detector/ranked_list.cc File components/metrics/leak_detector/ranked_list.cc (right): https://codereview.chromium.org/1472763003/diff/160001/components/metrics/leak_detector/ranked_list.cc#newcode40 components/metrics/leak_detector/ranked_list.cc:40: new_entry.value = value; I don't think there's any ...
5 years ago (2015-12-08 05:22:01 UTC) #38
Simon Que
https://codereview.chromium.org/1472763003/diff/160001/components/metrics/leak_detector/ranked_list.cc File components/metrics/leak_detector/ranked_list.cc (right): https://codereview.chromium.org/1472763003/diff/160001/components/metrics/leak_detector/ranked_list.cc#newcode40 components/metrics/leak_detector/ranked_list.cc:40: new_entry.value = value; On 2015/12/08 05:22:00, dcheng wrote: > ...
5 years ago (2015-12-08 06:03:42 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/180001
5 years ago (2015-12-08 06:04:07 UTC) #42
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/104463) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years ago (2015-12-08 06:06:04 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/200001
5 years ago (2015-12-08 08:26:11 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/67209)
5 years ago (2015-12-08 08:57:35 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/200001
5 years ago (2015-12-08 09:20:03 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/146026)
5 years ago (2015-12-08 09:44:47 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1472763003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1472763003/200001
5 years ago (2015-12-08 23:25:42 UTC) #55
commit-bot: I haz the power
Committed patchset #9 (id:200001)
5 years ago (2015-12-09 00:21:04 UTC) #56
commit-bot: I haz the power
5 years ago (2015-12-09 00:22:42 UTC) #58
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/096af097febf8a07d1323593e8cf94e83467ba71
Cr-Commit-Position: refs/heads/master@{#363836}

Powered by Google App Engine
This is Rietveld 408576698