10

I've built an application that wastes 40% of its time collecting garbage, and I'm at my wits' end trying to find out where it is coming from. I've corralled any possible problems in my own code, yet it persists. I'm beginning to suspect some third party code of being the problem, and I'd like to know if I can somehow track down what is being garbage collected. If there's a Chrome-specific answer, that'd be great, but I'll take anything at this point.

shino
  • 4,562
  • 5
  • 38
  • 57

2 Answers2

2

In Chrome I would start with following:

  • DevTools > Profile
  • Take Heap Snapshot
  • Working with the application
  • Take Heap Snapshot again
  • Inspect the second snapshot in the comparision mode

Following links may be useful:

Oleg Kurbatov
  • 1,376
  • 1
  • 19
  • 32
  • I'm having some of the same issues as shino, and I'm not convinced that this would work very well. In my case the GC kicks in every second or so, so catching a low-use and high-use heap might be difficult. – UpTheCreek Aug 20 '13 at 11:29
0

Perhaps you could try Chrome's Heap Profiler?

Also, related questions to Javascript Heap profiling:

Community
  • 1
  • 1
Aleš
  • 8,896
  • 8
  • 62
  • 107