Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use IE7 Javascript memory leak detectors?

I downloaded the "Javascript Memory Leak Detector" for IE mentioned elsewhere on SO and also here but cannot figure out how to use it. Apparently there used to be another blog post that perhaps went into this detail, but the link to it from the above link is broken.

I've also tried using sIEve and it does a decent enough job except that I cannot get the "copy" function to work properly. That is, I'd like to copy the various statistics so that I can manipulate them offline and prepare a report for my manager. However as I say there are issues with copying the data, and so until I report those to the developers, and if they then fix the issue, all I can get are non-interactive screen-shots.

So I ask the SO community how they are using the above tools, or if they know of any other easy to use tools for measuring IE7 Javascript memory leaks, that I can use in preparing reports for management, e.g. from which you can export raw data.

Thanks in advance

like image 510
Dexygen Avatar asked Aug 11 '09 15:08

Dexygen


2 Answers

Here is my own experience with sIEve in the approx. 24 hours since I asked this question. It provides ample, visual, albeit non-interactive data, e.g. "read only". It does provide a way to "copy" data it displays in its various "Show" grids, in my case "Show In Use". However the amount of data this results in when pasting into a text document goes well beyond what actually displays in the grid and is downright copious.

Let me elaborate my use case. sIEve wasn't indicating "leaks" per se but rather "orphans". To see what this means in sIEve parlance see this page.

Once I'd used the sIEve browser to access the page I was interested in I used the "Show in use" functionality to display a grid with about 10 or 12 fields. The column data is sortable by clicking on the header, so I was able to sort on the "Orphan" column and then select the range of rows that indicated "Yes" and then click "Copy"

However I asked this question in the first place because Copy either did not seem to be working, or crashed sIEve. I continued to encounter these problems about a third or half of the time but remained persistent and finally was able to paste raw data into a document.

As I've mentioned the amount of raw data is copious. So the only thing I've developed so far is a regular expression for counting the "records". Each record begins with a line such as the following:

http://localhost:8086/yms_web/yardmanager.do    (1 reference)

It will always indicate the number of references, so this is the regular expression I developed for finding these rows in the raw data; note I am using Cygwin for this:

$ egrep '\([0-9]+ reference[s]?\)' before_trailer_adjust_clicks.txt
http://localhost:8086/yms_web/yardmanager.do    (5 references)
http://localhost:8086/yms_web/yardmanager.do    (1 reference)
http://localhost:8086/yms_web/yardmanager.do    (2 references)

As you can see the regex is properly handling the possibility of plural references; I haven't seen it handle cases where there are double digit references but I believe it should.

In any event, by piping the above output to wc -l you quickly find out how many lines you have, so in my case, by capturing the data from the grid where "Orphan" equaled "Yes", and doing this over successive HTTP requests, I was able to see how the number of orphans was increasing, e.g:

$ egrep '\([0-9]+ reference[s]?\)' before_trailer_adjust_clicks.txt | wc -l
3

$ egrep '\([0-9]+ reference[s]?\)' after_trailer_adjust_click.txt | wc -l
4

$ egrep '\([0-9]+ reference[s]?\)' after_create_rftask_click.txt | wc -l
4

$ egrep '\([0-9]+ reference[s]?\)' after_create_rftask_close.txt | wc -l
66

$ egrep '\([0-9]+ reference[s]?\)' after_trailer_adjust_close.txt | wc -l
163

Of course the egrep command could be called inside a bash script looping over the files that are of interest but I haven't gone that far just yet.

By the way this is for an ExtJS app and I asked on their forum and got some good advice and was able to dramatically reduce the number of orphans!

Hope this helps others on SO and not sure why this question has been voted on to be closed

like image 156
Dexygen Avatar answered Nov 13 '22 12:11

Dexygen


Link is outdated, so I modified it to go to the root of the blog, and located the article via tags.

JavaScript Memory Leak Detector (v2)

like image 43
Josh Stodola Avatar answered Nov 13 '22 11:11

Josh Stodola