Hello,
I found your contacts on the Blink Memory Team page (https://www.chromium.org/blink/memory-team) and am hoping you can help point me in the right direction.
I work on performance and memory for a product called Microsoft Teams and have been investigating a memory bloat issue where the app’s memory consumption reaches 1+ gb on Chrome.
Our team is working on fixing up leaks in our code base but profiling shows that the majority of the memory is being consumed on the native side. (e.g. 200mb V8 vs 1+gb native).
I’ve collected traces using memory-infra and am trying to make sense of how to make these actionable on our end. An example trace has mem usage split across blink_gc (100mb), malloc (1gb), and partition_alloc (115mb), etc. The drill downs provided by //tracing provide a bit more information but I’m not very clear on what to make of the data. E.g. Of the 1+gb used by malloc, 840mb is listed as <unspecified> and 194mb is listed as metadata_fragmentation_caches.
Any guidance or help would be really appreciated.
Thanks in advance,
-DJ
Thanks for the quick response Kentaro! Cleaning up cc list.
I wasn’t aware of the native stack profiler. I’m setting up chromium source on my box now and will try it out. Btw, will symbolize_trace work on a basic memory-infra trace or do I need to run it through TraceOnTap?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.--
You received this message because you are subscribed to the Google Groups "memory-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
To post to this group, send email to memor...@chromium.org.
Erik, I thought we had the symbolize_trace script fixed up so it can work with traces from e.g. Chrome Canary, now?
Had some issues setting up a local Chromium build so tried another route by running symbolize_trace on a trace I collected from a dev build with heap profiling flag enabled (https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/489682/).
Symbolize_trace ran into an “list index out of range” error on so patched that up with a len check on stdout_data.
File "C:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1202, in _SymbolizeWin
Symbolize script runs successfully with following output.
Symbolizing...
Symbolizing 3 PCs from C:\Users\djpark\Temp\chromium\chrome-win32\chrome-win32\chrome.exe...
Symbolizing 14 PCs from C:\Users\djpark\Temp\chromium\chrome-win32\libglesv2.dll...
Symbolizing 3 PCs from C:\WINDOWS\SYSTEM32\ntdll.dll...
Symbolizing 1 PCs from C:\WINDOWS\System32\KERNEL32.DLL...
Symbolizing 8685 PCs from C:\Users\djpark\Temp\chromium\chrome-win32\chrome_child.dll...
If I load the symbolized trace into chrome://tracing, I’m not seeing much of a difference unfortunately. E.g. There is still a large chunk of memory usage categorized as <unspecified> under malloc category

Would be great to get some help with a few questions:
Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To post to this group, send email to memor...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.

Thanks Etienne. Trace attached. Comparing the output you shared with my output, doesn’t look like symbols are loading in properly.
As I mentioned in my earlier mail, 1) I did have to work around that error in the symbolize_trace script and 2) I used a pre-built version of chrome to collect the initial trace. Any tips on validating that symbol version and trace version are matching?
From: Etienne Bergeron [mailto:etie...@google.com]
Sent: Friday, July 28, 2017 12:20 PM
To: DJ Park <djp...@microsoft.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org; memor...@chromium.org
Subject: Re: Investigating memory bloat in Chromium
An unsymbolized trace will contains raw PC addresses:

After the symbolisation, addresses are replaced by symbols (when available) or <lib + offset> otherwise.
On Fri, Jul 28, 2017 at 3:14 PM, Etienne Bergeron <etie...@google.com> wrote:
Can you share you trace?
I'm gonna check for the symbolisation part.
On Fri, Jul 28, 2017 at 3:10 PM, DJ Park <djp...@microsoft.com> wrote:
Had some issues setting up a local Chromium build so tried another route by running symbolize_trace on a trace I collected from a dev build with heap profiling flag enabled (https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/489682/).
Symbolize_trace ran into an “list index out of range” error on so patched that up with a len check on stdout_data.
File "C:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1202, in _SymbolizeWin
Symbolize script runs successfully with following output.
Symbolizing...
Symbolizing 3 PCs from C:\Users\djpark\Temp\chromium\chrome-win32\chrome-win32\chrome.exe...
Symbolizing 14 PCs from C:\Users\djpark\Temp\chromium\chrome-win32\libglesv2.dll...
Symbolizing 3 PCs from C:\WINDOWS\SYSTEM32\ntdll.dll...
Symbolizing 1 PCs from C:\WINDOWS\System32\KERNEL32.DLL...
Symbolizing 8685 PCs from C:\Users\djpark\Temp\chromium\chrome-win32\chrome_child.dll...
If I load the symbolized trace into chrome://tracing, I’m not seeing much of a difference unfortunately. E.g. There is still a large chunk of memory usage categorized as <unspecified> under malloc category
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
To help clarify the repro, here are the exact steps I took:
Based on what you’re saying, sounds like the appropriate PDB isn’t getting loaded in. Any ideas on how I can fix this?
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome

To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome

3) Be sure native heap profiling is activate (chrome://flag)
4) Collect a trace (chrome://tracing) with memory-infra (about 2 or 3 seconds)
6) Save the trace to a temporary file.
C:\src\traces\test>c:\python_27\files\python.exe c:\src\chromium\src\third_party\catapult\tracing\bin\symbolize_trace --addr2line-executable c:\src\chromium\src\out\build\addr2line-pdb.exe trace_test.json.gz
No errors should happens.
If any steps is not going the same way than above, tell me.
Tried running through these steps with pdb’s side by side with exe’s. Also removed the if check I added in symbolize script.
When I run symbolize_trace I still get the previou index out of range error:
Trace loaded for Windows NT/62.0.3168.0
Symbolizing...
Symbolizing 6 PCs from C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll...
usage: addr2line-pdb [-f|--functions] [-C|--demangle] [-e filename]
(Then list the hex addresses on stdin, one per line)
Traceback (most recent call last):
File "c:\Sources\chromium\src\third_party\catapult\tracing\bin\symbolize_trace", line 17, in <module>
sys.exit(symbolize_trace.main(sys.argv[1:]))
File "c:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1659, in main
SymbolizeTrace(options, trace, symbolizer)
File "c:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1407, in SymbolizeTrace
SymbolizeFiles(symfiles, symbolizer)
File "c:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1309, in SymbolizeFiles
symbolizer.SymbolizeSymfile(symfile)
File "c:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1257, in SymbolizeSymfile
self._SymbolizeWin(symfile)
File "c:\Sources\chromium\src\third_party\catapult\tracing\tracing\extras\symbolizer\symbolize_trace.py", line 1201, in _SymbolizeWin
frame.name = stdout_data[i * 2]
IndexError: list index out of range
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
1) You do not have the appropriate env variable. This is telling dbghelp where to fetch symbols.
example: _NT_SYMBOL_PATH=SRV*c:\src\symbols*https://msdl.microsoft.com/download/symbols;SRV*c:\src\symbols*https://chromium-browser-symsrv.commondatastorage.googleapis.com
2) You do not have a dbghelp with remote symbols support. The solution is to install a SDK which is providing a DLL with remote symbols enabled.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
Crossed my fingers but still no luck ☹ Just tried running the script with the –only-symbolize-chrome-symbols flag but still getting the same output I shared earlier.
Just to confirm, it should be fine to use any version of the addr2line-pdb.exe right? Wondering why the “usage: addr2line-pdb [-f|--functions] [-C|--demangle] [-e filename]” message gets printed in the output.
Also, here’s how I ran my command.
C:\>c:\Python27\python.exe c:\Sources\chromium\src\third_party\catapult\tracing\bin\symbolize_trace --addr2line-executable c:\Sources\chromium\src\third_party\tcmalloc\vendor\vsprojects\addr2line-pdb\Debug\addr2line-pdb.exe --only-symbolize-chrome-symbols c:\Sources\chromium\src\third_party\catapult\tracing\bin\trace_test.json.gz
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
To post to this group, send email to memor...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/memory-dev/CAEYHnr1yTfYgO4qPkzV6wg%2Bio-5i-gyo%3D2mTRqvZQ05YuPcnrw%40mail.gmail.com.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
What do you mean when you say “command-line executed to symbolize”? I’ve attached the specific version of the symbolize_trace script I’ve been running. I should mention that I’ve tried running this script in both cmd/shell and still getting the same error as earlier.
As for “trace with this exact version”, are you saying that you want me to sync my chromium source to the exact version of the chrome/symbols I used to collect the trace? If so, I’ve attached the latest trace I took with this build - https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/489682/
3) Be sure native heap profiling is activate (chrome://flag)
4) Collect a trace (chrome://tracing) with memory-infra (about 2 or 3 seconds)
5) Check that the trace contains a memory dump with unsymbolized stack frames:
6) Save the trace to a temporary file.
7) Symbolize the saved trace
C:\src\traces\test>c:\python_27\files\python.exe c:\src\chromium\src\third_party\catapult\tracing\bin\symbolize_trace --addr2line-executable c:\src\chromium\src\out\build\addr2line-pdb.exe trace_test.json.gz
No errors should happens.
8) Reload the symbolized trace
If any steps is not going the same way than above, tell me.
On Mon, Jul 31, 2017 at 12:55 PM, Etienne Bergeron <etie...@google.com> wrote:
> Collected trace using above dev build from chrome://tracing after enabling “enable heap snapshot” option under chrome://flags
"Enable heap snapshot" ? You need to activate heap profiline, with the option "native mode".
note: I'm running a python 64-bit version. Otherwise, the python script is often throwing a MemoryError.
You may face this issue too.
On Mon, Jul 31, 2017 at 12:46 PM, Etienne Bergeron <etie...@google.com> wrote:
If you are using a build from https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/489682/, you can download the PDBs with the executables.
You need to put the PDBs side by side with the executable, and the dbghelp API will be able to find them automatically.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome


To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
Success! Looks like the intense crossing of fingers did the trick 😊 That, and an issue I found in symbolize_trace.py where the args being passed into the Popen were incorrect. The version of addr2line-pdb.exe must be different than the one you have.
Original: cmd = [self.symbolizer_path, '--functions', '--demangle', '--exe', symfile.symbolizable_path]
Fixed: cmd = [self.symbolizer_path, '--functions', '--demangle', '-e', symfile.symbolizable_path]
Now that I’ve got a symbolized trace, definitely seeing some more interesting details. Symbolized trace attached + specific questions called out below. Would love to get your insights in any of these. I know there’s a lot of questions so please let me know if it would be easier to set up a quick call instead. Thanks!
Total memory usage for our app in trace: 667mb






From: Etienne Bergeron [mailto:etie...@google.com]
Sent: Tuesday, August 1, 2017 10:11 AM
To: DJ Park <djp...@microsoft.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org; memor...@chromium.org
Subject: Re: Investigating memory bloat in Chromium
> As for “trace with this exact version” [...]
No, I was asking for a trace from that specific version:
which is what you did. :)
I was able to symbolize your trace without any problem.

> What do you mean when you say “command-line executed to symbolize”?
The attached version of your symbolization script is only a wrapper to call the real script.
You can see it here: src\third_party\catapult\src\tracing\tracing\extras\symbolizer\symbolize.py
You can add the following print statement to see the running command-line.

To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
Quick ping on this to keep the thread alive. Thanks in advance!

To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
Used ninja to generate the addr2-line.pdb and re-ran the script. Looks like stack frames are being resolved now. Updated trace attached.
Interesting observations in this particular trace. CC is taking up 112.3mb. Majority of this is coming from tile_memory which is chunked into resources of sizes varying from a few kb to 5+mb. I imagine this is a consequence of our DOM/styles being quite complex. We’re working on reducing this complexity, but any other tips on reducing this bucket?
As for interpreting the stack frame / object type results, can you help me understand how I should be reading this? Let’s take partition_alloc for example. If I sort the Object types by size and picked the largest one (WTF::StringImpl @ 37.5mb) then switch to Stack Frame view, I have a list of stack frames associated with that object type. How should I be reading this list of stack frames and is there a way to map back to where that 37.5mb of strings were allocated from?
From: Etienne Bergeron [mailto:etie...@google.com]
Sent: Thursday, August 3, 2017 11:24 PM
To: DJ Park <djp...@microsoft.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org; memor...@chromium.org
Subject: Re: Investigating memory bloat in Chromium
I quickly look to your symbolized trace, and symbolisation didn't worked correctly.
The stackframe are not resolved correctly.

You are probably using an incorrect version of addr2line-pdb.
Take care, there are two version:
If you are using ninja to build chrome, simply use:
ninja -C out\<build-folder> addr2line-pdb.c
This is compiling this target:
On Thu, Aug 3, 2017 at 8:06 AM, DJ Park <djp...@microsoft.com> wrote:
Quick ping on this to keep the thread alive. Thanks in advance!
From: DJ Park
Sent: Tuesday, August 1, 2017 2:01 PM
To: 'Etienne Bergeron' <etie...@google.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org; memor...@chromium.org
Subject: RE: Investigating memory bloat in Chromium
Success! Looks like the intense crossing of fingers did the trick 😊 That, and an issue I found in symbolize_trace.py where the args being passed into the Popen were incorrect. The version of addr2line-pdb.exe must be different than the one you have.
Original: cmd = [self.symbolizer_path, '--functions', '--demangle', '--exe', symfile.symbolizable_path]
Fixed: cmd = [self.symbolizer_path, '--functions', '--demangle', '-e', symfile.symbolizable_path]
Now that I’ve got a symbolized trace, definitely seeing some more interesting details. Symbolized trace attached + specific questions called out below. Would love to get your insights in any of these. I know there’s a lot of questions so please let me know if it would be easier to set up a quick call instead. Thanks!
Total memory usage for our app in trace: 667mb
- Blink_GC - 68mb
- What does an object type of blink::Node correspond to? Trying to understand why the size/count is so high
- What does object count represent? Trying to understand what it means when SVGAnimatePropertyBase has a count of 42,640.
- The highlight object type looks very complex. Is there an underlying issue here?
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
The output are JSON files (folder output):
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+unsubscribe@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
Thanks for the pointers (and for the great help so far). Definitely owe you a meal/drink if you’re ever in Seattle area.
Detecting leaks is one part of our investigation but the other part is simply understanding why certain allocations are happening and if there are things we can do from HTML/JS land to reduce these. For that, could use some guidance on how to interpret the trace results.
Would you have some time to hop on a call in the next week or two? Or perhaps there’s someone else on this alias who could also help?
From: Etienne Bergeron [mailto:etie...@google.com]
Sent: Friday, August 4, 2017 10:13 AM
To: DJ Park <djp...@microsoft.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org; memor...@chromium.org
Subject: Re: Investigating memory bloat in Chromium
I didn't look to your trace and I won't have time today. But here is a tool that may help you:
src/third_party/catapult/experimental/tracing/bin/diff_heap_profiler.py
Run your apps, collect a trace, run it for a while, collect a trace... and diff both traces.
You'll get json file of "potential memory leaks".
The output are JSON files (folder output):
You can use an online JSON viewer
to format properly these and navigate these files.
You can also run it with only one trace and play with the threshold to get what are the top allocations.
On Fri, Aug 4, 2017 at 12:39 PM, DJ Park <djp...@microsoft.com> wrote:
Forgot to attach trace.
From: DJ Park
Sent: Friday, August 4, 2017 9:39 AM
To: 'Etienne Bergeron' <etie...@google.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org; memor...@chromium.org
Subject: RE: Investigating memory bloat in Chromium
Used ninja to generate the addr2-line.pdb and re-ran the script. Looks like stack frames are being resolved now. Updated trace attached.
Interesting observations in this particular trace. CC is taking up 112.3mb. Majority of this is coming from tile_memory which is chunked into resources of sizes varying from a few kb to 5+mb. I imagine this is a consequence of our DOM/styles being quite complex. We’re working on reducing this complexity, but any other tips on reducing this bucket?
As for interpreting the stack frame / object type results, can you help me understand how I should be reading this? Let’s take partition_alloc for example. If I sort the Object types by size and picked the largest one (WTF::StringImpl @ 37.5mb) then switch to Stack Frame view, I have a list of stack frames associated with that object type. How should I be reading this list of stack frames and is there a way to map back to where that 37.5mb of strings were allocated from?
To unsubscribe from this group and stop receiving emails from it, send an email to memory-dev+...@chromium.org.
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
--
Etienne Bergeron
Chrome
Thanks for the follow up Daniel.
When you refer to Node objects, are you referring to the object_count listed under “counter” column? I’m seeing 38,530 in the trace I last sent so want to make sure we’re looking at the same thing.
We’re currently using Angular which makes heavy use of scripts for templates. We also use inline svg’s (which increase DOM complexity), have a fair amount of images, make use of canvas in several parts of the app, etc. Is there any documentation on DOM elements that typically end up owning a lot of memory beyond themselves? Would be great to understand which areas to focus on to get the most bang.
As for using the devtool memory tools (heap snapshot, allocation profile/timeline), my understanding is that this is just giving me a breakdown of JS heap and not the native mem usage related to various components. Is there a way to attribute native mem usage to the JS objects that I’m missing?

No worries. Understand this is a very complex problem and there isn’t a silver bullet.
When you say be careful with video, audio, canvas, img elements, any tips on how we should be careful? Are there certain usage patterns that cause these elements to retain more memory?
Also, I’d love love love to pick your (or someone else in the know)’s brain about what these different components represent. For example, what exactly is a node object? Our app starts off with ~6k elements on page (yes, we’re working on reducing this 😊) but this is nowhere near the ~38k being reported as node objects.
I’d be happy to document whatever we discuss and contribute back. Current documentation is good for laying out the high level tooling and components, but stops short of diving into the next level of detail which I feel would really help equip devs to fish on their own. Happy to jump on a call anytime so please let me know.
Thanks
-DJ
From: Daniel Bratell [mailto:bra...@opera.com]
Sent: Wednesday, September 6, 2017 2:27 AM
To: Etienne Bergeron <etie...@google.com>; 'DJ Park' via memory-dev <memor...@chromium.org>; DJ Park <djp...@microsoft.com>
Cc: Erik Chen <erik...@chromium.org>; Wez <w...@chromium.org>; Kentaro Hara <har...@chromium.org>; dsk...@chromium.org
Subject: Re: Investigating memory bloat in Chromium
Yes, it was the Node object count that caught my eye.
I don't think there is a comprehensive list of indirect memory use per Element type. I know that you need to be careful with video, audio, canvas and maybe img elements.
The connection between what devtools reports and actual memory used is indeed a bit loose, but there is often a correlation. If you can debug from devtools, which has rather easy to use tools compared to the C++ side, then maybe you can figure out if something is wrong in the web page itself.
Sorry for being a bit abstract. I wish I could give some easy suggestions but figuring out the cause of high memory usage remains a complicated problem where few instances are identical.
/Daniel
On Tue, 05 Sep 2017 23:39:58 +0200, DJ Park <djp...@microsoft.com> wrote:
Thanks for the follow up Daniel.
When you refer to Node objects, are you referring to the object_count listed under “counter” column? I’m seeing 38,530 in the trace I last sent so want to make sure we’re looking at the same thing.
We’re currently using Angular which makes heavy use of scripts for templates. We also use inline svg’s (which increase DOM complexity), have a fair amount of images, make use of canvas in several parts of the app, etc. Is there any documentation on DOM elements that typically end up owning a lot of memory beyond themselves? Would be great to understand which areas to focus on to get the most bang.
As for using the devtool memory tools (heap snapshot, allocation profile/timeline), my understanding is that this is just giving me a breakdown of JS heap and not the native mem usage related to various components. Is there a way to attribute native mem usage to the JS objects that I’m missing?
Hi all,
Just ran into a case where our app native memory bloated to 600mb+ and noticed some interesting changes from the previous trace I shared. Note that this trace is taken from the electron version of our app so may have slightly different characteristics from the pure web trace. I need to figure out how to get a symbolized trace using electron but in the meantime would be great to see if anyone has any insights with the following:
1. Memory under cc category is abnormally high with image cache being at 156mb (previous trace I sent 51mb). Is there any way to track down what images are being cached?


Thanks
-DJ