0

How can I record memory leaks in Google Chrome similar to what is being performed in the link bewow?

https://github.com/driftyco/ionic/issues/1096

I have an Ionic app that runs embedded video, after clicking back and forth for over 10 pages during intense clicking it crashes. The pages viewed are embedded mp4s, I suspect there is some memory leakage as listed in the link above? Just need to find a way to test it

Following the post below from Ant, here is the memory log from Google Canary https://i.stack.imgur.com/2DKC5.jpg. Do the nodes and listeners look unusual?

me9867
  • 1,519
  • 4
  • 25
  • 53

1 Answers1

0

Get chrome canary then open developer tools and click on profiles.

Using the tools there you can take heap snapshots and compare memory allocations between snapshots to see what is staying in memory or you can record heap allocations which records memory allocation in real time on a timeline so you can dig in and find where memory is not being released.

https://developer.chrome.com/devtools/docs/javascript-memory-profiling

There are some very good guides on the technicalities of doing the above if you google how to find memory leaks.

Ant
  • 356
  • 2
  • 15
  • Ive tried Canary now and edited the post above to show the memory log. Not sure whether that listener and node activity is right or not? – me9867 Apr 22 '16 at 14:26
  • Are you using html5 video player? How many videos are on the dom? Are you stopping each video before playing another? To release the memory you can remove the src or you can remove them from the dom by not caching views. – Ant Apr 22 '16 at 14:37
  • The videos are stopped with video.pause(); when you browse away and in the product page we have source src="{{product.video}}. For these pages we have the controller set as cache: false, – me9867 Apr 22 '16 at 15:02
  • videoElement.src =""; could be the winner – me9867 Apr 22 '16 at 15:43