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

Issue 1676453002: Change initialization strategy of AllocationRegister back (Closed)

Created:
4 years, 10 months ago by hajimehoshi
Modified:
4 years, 10 months ago
CC:
blink-reviews, chromium-reviews, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change initialization strategy of AllocationRegister back AllocationRegister in PartitionAllocMemoryDumpProvider should be initialized only when necessary to avoid waste of memory. This initialization strategy was changed at crrev.com/1642023007 accidentally, and this CL changes this back. BUG=584611 TEST=n/a Committed: https://crrev.com/d7036a2197e53a8d5a33b11a0c4967046431257f Cr-Commit-Position: refs/heads/master@{#373802}

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -3 lines) Patch
M third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp View 3 chunks +11 lines, -3 lines 4 comments Download

Depends on Patchset:

Messages

Total messages: 15 (4 generated)
hajimehoshi
PTAL
4 years, 10 months ago (2016-02-05 11:12:48 UTC) #2
haraken
LGTM https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp File third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp (right): https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp#newcode172 third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp:172: MutexLocker locker(m_allocationRegisterMutex); Nit: It would be heavy to ...
4 years, 10 months ago (2016-02-05 11:20:59 UTC) #3
Primiano Tucci (use gerrit)
LGTM thanks for the prompt fix! https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp File third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp (right): https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp#newcode172 third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp:172: MutexLocker locker(m_allocationRegisterMutex); On ...
4 years, 10 months ago (2016-02-05 11:42:08 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1676453002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1676453002/1
4 years, 10 months ago (2016-02-05 11:54:39 UTC) #6
haraken
> https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp > File third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp > (right): > > https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp#newcode172 > third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp:172: > MutexLocker locker(m_allocationRegisterMutex); ...
4 years, 10 months ago (2016-02-05 13:18:51 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 10 months ago (2016-02-05 13:26:43 UTC) #8
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/d7036a2197e53a8d5a33b11a0c4967046431257f Cr-Commit-Position: refs/heads/master@{#373802}
4 years, 10 months ago (2016-02-05 13:27:58 UTC) #10
esprehn
https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp File third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp (right): https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp#newcode163 third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp:163: PartitionAllocHooks::setFreeHook(nullptr); should we clear m_allocationRegister here? What eventually cleans ...
4 years, 10 months ago (2016-02-09 07:07:13 UTC) #12
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp File third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp (right): https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp#newcode163 third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp:163: PartitionAllocHooks::setFreeHook(nullptr); On 2016/02/09 07:07:13, esprehn wrote: > should we ...
4 years, 10 months ago (2016-02-09 11:00:24 UTC) #13
esprehn
On 2016/02/09 at 11:00:24, primiano wrote: > https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp > File third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp (right): > > https://codereview.chromium.org/1676453002/diff/1/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp#newcode163 ...
4 years, 10 months ago (2016-02-09 11:43:40 UTC) #14
Primiano Tucci (use gerrit)
4 years, 10 months ago (2016-02-09 12:36:46 UTC) #15
Message was sent while issue was closed.
On 2016/02/09 11:43:40, esprehn wrote:
> Does that mean if I open about:tracing, record a memory profile, close
tracing,
> I can never record another memory profile? Or that I'm stuck with a permanent
> memory increase after recording the memory profile?

Nope that will work as you expect.
The "only once" exception applies only to the special case of:
- you start chrome with --enable-heap-profiling
- you start tracing with memory-infra (which will give you the extra heap
details).

In this scenario:
Today: you are stuck with the extra memory increase of the register even after
you stop tracing.
As I said this is a bug I am going to fix soon (just didn't bother prioritizing
that).

In the near future:
Once you stop tracing, memory usage will go back as expected.
If you restart tracing, memory infra will work as expected w.r.t. the standard
probes that we have. However, the pane about the heap details will show some red
warning (inconsistent data or similar)

The reason is: if you stop profiling, you stop tracking malloc/partalloc
allocations, you lose data that you are never going to be able to catch again.
You could argue that you might still be able to get the data for the allocations
happened in the timeframe [when you re-enabled tracing the 2nd time, when you
stopped tracing the 2nd time]
that will work, but that data is going to be misleading, as you dropped on the
floor all the allocations that happened before, and that might be still
outstanding.

That's why I said above that, for detailed heap profiling, I intend to support
only the case of: you trace once, since the beginning, and once you stop you are
done.
Technically we could do that, but the final result would be so hard to explain
(due to the reason above) that I prefer saying "you can't do this, period".

Does it make sense?

Powered by Google App Engine
This is Rietveld 408576698