如何使用IE7 Javascript内存泄漏检测器? [英] How to use IE7 Javascript memory leak detectors?

查看:95
本文介绍了如何使用IE7 Javascript内存泄漏检测器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了在SO和

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.

我也尝试过使用sIEve,它做得不错,只是无法使复制"功能正常工作.也就是说,我想复制各种统计信息,以便可以脱机操作它们并为经理准备报告.但是,正如我所说的那样,复制数据存在问题,因此,直到我将这些报告给开发人员,然后他们解决了该问题,我所能获得的只是非交互式的屏幕截图.

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社区他们如何使用上述工具,或者他们是否知道用于评估IE7 Javascript内存泄漏的任何其他易于使用的工具,这些工具可用于准备管理报告,例如您可以从中导出原始数据.

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.

预先感谢

推荐答案

以下是我自己对sIEve的经验.自问这个问题以来的24小时.它提供了充足的,可视的,尽管是非交互式的数据,例如只读".它确实提供了一种复制"其在各种显示"网格中显示的数据的方法,在我的案例中是使用中显示".但是,粘贴到文本文档中时所导致的数据量远远超出了网格中实际显示的数据量,而且是非常庞大的.

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.

一旦我使用sIEve浏览器访问了我感兴趣的页面,我就使用了使用中显示"功能来显示包含大约10或12个字段的网格.通过单击标题可以对列数据进行排序,因此我能够对孤立"列进行排序,然后选择指示是"的行范围,然后单击复制"

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)

它将始终指示引用的数量,因此这是我为在原始数据中查找这些行而开发的正则表达式;注意,我为此使用Cygwin:

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.

无论如何,通过将上述输出传递给wc -l,您可以快速找出有多少行,因此,在我的情况下,是从"Orphan"等于"Yes"的网格中捕获数据,然后执行此操作通过连续的HTTP请求,我能够看到孤儿的数量是如何增加的,例如:

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

当然,可以在bash脚本中调用egrep命令,循环遍历感兴趣的文件,但是我还没有走那么远.

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.

通过这种方式使用ExtJS应用程序,我在他们的论坛上提问并获得了很好的建议,并且能够大大减少孤儿的人数!

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

这篇关于如何使用IE7 Javascript内存泄漏检测器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆