Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Heap Snapshot Growing at every refresh.. normal?

I'm trying to do some performance/efficiency testing with Chrome Developer tools and their "Profile" tab...

I'm getting the following results When I load up the page, do a Heap Snapshot, refresh the page, Heap Snapshot, etc... repeatedly..

Heap Snapshot

This question is 2 fold..

  1. Is this normal? do I have a memory issue?

  2. Can anyone point me to a resource to interpret the output of chrome's heap snapshot and cpu profiling?

like image 289
jondavidjohn Avatar asked Dec 07 '11 17:12

jondavidjohn


People also ask

What is heap snapshot in Chrome?

Google Chrome heap snapshot will reveal memory distribution between JavaScript objects and associated DOM nodes. This feature is useful because you will be able to compare different snapshots and find memory leak.

What is heap snapshot?

Heap snapshots are one way to identify detached nodes. As the name implies, heap snapshots show you how memory is distributed among your page's JS objects and DOM nodes at the point of time of the snapshot.

How do I check my Chrome heap memory?

The Chrome DevTools heap profiler shows memory distribution by your page's JavaScript objects and related DOM nodes (see also Objects retaining tree). Use it to take JS heap snapshots, analyze memory graphs, compare snapshots, and find memory leaks.


2 Answers

This issue happens because you have chrome extensions that are retaining part of your DOM upon refresh for whatever reason.

When using the profile tools always go into incognito mode, no extensions are loaded here and you can be sure that the objects you see in the profile are only yours... well, mostly; you will also see chrome internal data structures wrapped in parentesis like (compiled code) or (system). Ignore those, you have no control over them.

Who would've said that incognito mode has other uses apart from... you know ;-)

like image 75
monzonj Avatar answered Nov 08 '22 22:11

monzonj


  1. It may or may not be normal. You'd have to analyze the difference between snapshots to tell.
  2. Have you looked at the profiling docs?
like image 23
Dmitry B. Avatar answered Nov 09 '22 00:11

Dmitry B.