FYI, we are debugging our mobile hybrid app which was develop using angularJS 1.4.2 and ionic framework 1.2.4 with WKWebView.
The multiple snapshots below is to show the events before and after. Based on webkit memory debugging article, the snapshot will show the live JavaScript objects which has not yet been GC.
Snapshot 2 showing the default state of page A and controller A.
Snapshot 5 is still in the same page but after doing some calculation and generated a base64 string pdf from PDFTron to view it on UIWebview.
Snapshot 10 showing after exit page A and navigate to page C with controller C.
Comparison of snapshot 2 and snapshot 10, all the base64 string still remain there.
Questions:
Update
There was a new article released on the memory debugging. This article include a more detail steps and the procedure.
Answers
After going through few months of memory debugging on the apps, we have some addition finding on debugging the memory leaks.
Memory debugging steps
Some suggestion here for those who might also want to use the memory debugging in the future. Current steps for memory debugging:
*Remember always take the latest snapshot. Eg. use snapshot 5 and 6 instead of 1 and 2 because the earlier snapshot might have the chance to be GC and the result will not be accurate.
With this steps, it was better to find out and pin point the memory leaks section. Normally we will track the object, function and array count. If there were memory leaks, the number of count will be increase when comparing the snapshot. Some other memory leaks item will be the $$ inside the object count. This kind of object might cause memory leaks as the object is not in use anymore but is still reference by other parts of the application.