Chrome timeline slow GC events - google-chrome

This screenshot is from my chrome extension. I'm just scrolling the screen up and down, and it keeps freezing. Looks like it's caused by garbage collection. How can I figure out why this is happening?
No code is running as far as I'm aware. I'm just scrolling the page. Why would it keep dumping 27MB of memory every second!?
I can't take a heap snapshot because it takes forever, then actually crashes the plugin.

Once it invokes GC, that means you are having something allocated on JS heap.
You can use heap profiler to find out what's that. Go to Profiles panel and use Record Heap Allocations tool.

Related

Memory leak in Task Manager even if Chrome Heap Snapshot shows zero delta

I am investigating a JS memory leak issue using Chrome DevTools. Using heap snapshots and doing comparison, I was able to root cause the component responsible for leaking the memory.
Problem I am seeing is that after the fix, even if Chrome DevTools shows no leak, Windows Task Manager shows increase in memory with usage.
Below are the heap snapshots of before and after fix.
Before fix:
After fix:
Am I missing anything here? Is Chrome DevTools somehow showing wrong result?
I read a similar thread here. But it isn't of much help.

Recording Heap Allocations in 2018 Chrome Dev Tools?

Google's documentation on how to do this is now out of date: https://developers.google.com/web/tools/chrome-devtools/memory-problems/allocation-profiler
The dev tools UI has changed since this was written (I'm using v66), and I can't figure out how to get to a heap allocation bar graph which looks like this:
Can anyone walk me through this? I've gone to Settings and checked Record heap allocation stack traces which I believe is one step that is required to do this. In the performance tab I've checked the memory box and have recorded some actions, but once that's done I get more of a line graph for heap, rather than a bar graph:
Halp?
Memory profilers are moved to Memory panel. The one you're looking for is called "Allocation instrumentation on timeline".

This node is not attached to the dom heamsnapshot memory leak or not?

I have an application in which the size of objects increases when we use the site. I am trying to find memory leaks in my application and found some things that causes memory leaks in javascript. Well, we are using angularjs. Now, i just looked something in IE heap snapshot but i am not sure it causes memory leak or not?
Whenever i click on some specific tab, i see same HTML in heap snapshot and IE says "This Node Is Not Attached To The DOM". Below is the image:
These nodes increases whenever i exit from specific page. Is this causes memory leak? If it is the problem then how i can resolve this?

Chrome garbage collector going crazy

Using Version 48.0.2564.109 m.
We have a javascript web app (built with ExtJS). In Chrome, when we leave our app sitting there for a while, the GC starts going nuts. In Task Manager, you can see the CPU constantly spinning around 25%.
I took timeline snapshots and CPU profiles, and you can see the GC, about 10 times a seconds, try to collect memory, but collects 0B.
Our app is a large enterprise application and does use quite a bit of memory and updates the screen periodically.
But, there is absolutely no javascript code running during this time. So I can't see that it is something our app is actively doing
Does anyone know what could be triggering this?
It is killing performance of our app.
Also, it only happens when our tab is active. If you switch to a different tab, the CPU dies down and the GC stops.
Is there other data I need to collect to help determine this?
What is your app current JS heap size? You can check it by collecting timeline and enabling memory check box.
It looks like your app is close to the V8 memory limit, so V8 is trying to free some memory. If it is expected for the app to use that much memory, you can increase the limit on your host with something like: --js-flags="--max-old-space-size=2048"
Otherwise it might be just a memory leak in your code. Use heap profiler to hunt it down.

Chrome dev tools first memory heap snapshot is mysteriously large

I'm using the Profiles tab in the Chrome developer tools to record memory heap snapshots. My app has a memory leak, so I'm expecting the snapshots to gradually increase in size, which they do. But for reasons I don't understand, the first snapshot is always artificially large... creating a seemingly deceptive drop in memory between the first and second. All subsequent snapshots gradually increase as expected.
I know there is often extra memory used at the beginning of a page load, due to caching and other setup. But the same thing happens no matter when I take the first snapshot. It could be 30 seconds after the page is loaded or 30 minutes. Same pattern. My only guess is that the profile tool its self is interacting with the memory somehow, but that seems like a stretch.
Any ideas what's going on here?
Right before memory snapshot is taken Chrome tries to collect the garbage. It doesn't collect it thoroughly though, it only does a predefined number of passes (this magic number seems to be 7). Therefore, when the first snapshot is taken there still might be some uncollected garbage left.
Before making a first snapshot try going to the "Timeline" tab and forcing garbage collection manually.
From what I've tested, this always reduces the size of the first snapshot.