46

In latest Chrome DevTools I can see a new information:

enter image description here

Now, I'm not sure how to use this information. It seems to appear randomly in the app. How can I debug the app to avoid potential out-of-memory crashes? I checked in task manager that at the moment when this information appears the app uses about 55K memory which in case of this app is quite low (when it computes some data it can be much higher memory consumption).

So I'm wondering if this information is accurate and there is a risk of crashing. If so, what should I do with it?

Pawel Uchida-Psztyc
  • 3,735
  • 2
  • 20
  • 41
  • 1
    If this memory-hogging is happening every time you run your app, it might be the culprit for these memory leaks. Try to check your code for the lines that causes these leaks. Read this [google forum thread](https://productforums.google.com/forum/#!topic/chrome/y0TA3QnT9yQ) as well for additional info. – ReyAnthonyRenacia Feb 09 '17 at 15:04
  • 1
    Do you get this error in regular Chrome, or just Canary? According to this [discussion](https://github.com/mapbox/mapbox-gl-js/issues/4330), it only happens when the DevTools are open, and their opinion is that it's a Chrome bug. – mattsahr Mar 02 '17 at 14:33
  • Took me ages to even see this, I was wondering why my processes (which are promises inside promises inside promises which call workers) were even stalling on it. Seems like unwanted behaviour to me. I see it in Opera 45, so it's a bug in the common chromium engine I guess. – frumbert Jun 19 '17 at 08:50
  • Getting this error on Chrome 98, previously had not experienced it - as far as I can tell it was not code changes that caused this error but the Chrome 98 upgrade – danday74 Feb 18 '22 at 12:52
  • In my case this error was showing because of infinite loop, check you've added loops recently and if loops aren't infinite check if the array you're looping is updating inside loop or not (which shouldn't update) – Akshay Pagare Apr 20 '23 at 13:58

3 Answers3

9

Record a profile with memory tab in chrome dev tools. You can investigate there which functions consume memory

Chrome memory tab

Here's a great guide: https://developer.chrome.com/docs/devtools/memory-problems/

Community
  • 1
  • 1
mate.gvo
  • 1,093
  • 14
  • 20
2

Maybe this is late and very obvious, but you can use the "Memory" tab in the Chrome developer tools to create a memory snapshot while loading/browsing your app in order to investigate what is eating up your memory (given that it actually is your app that is eating up the memory).

activist
  • 121
  • 9
  • 3
    This is good in theory... but the error happens when there is no memory left. Running the "Heap snapshot" profile on the Memory tab crashes with "Not enough memory to open this page" showing. :( – Glen Little Jan 09 '19 at 19:08
  • Agree. In case of crash this Heap snapshot profile on the Memory tab of crome is also not loading. – Hardik Patel May 02 '22 at 04:58
0

Other answers suggests taking a snapshot using Chrome's Memory tab. However, when there's a serious memory bloat - Chrome just crashes without creating the snapshot.

So an alternative is just create a dump using the operating system. On Windows, go to the Task Manager, expand the Chrome process > right click > Create dump file:

enter image description here

The .dmp file can be then analyzed using different debuggers, like WinDbg. That's far from the conveience of Chrome Memory tab analysis, but sometimes it's all there is.

OfirD
  • 9,442
  • 5
  • 47
  • 90