在哪里可以找到页面的实际内存使用情况(包括图像和多媒体)? [英] Where can I find the real memory use of a page (including images and multimedia)?

查看:159
本文介绍了在哪里可以找到页面的实际内存使用情况(包括图像和多媒体)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Chrome和Firefox的内存检查器中发现了一件奇怪的事.在大页面上,它将告诉您各种JavaScript对象占用了多少,但似乎没有列出任何图像/多媒体对象.实际上,从Chrome开发人员工具的配置文件面板中截取的屏幕截图中,您可以看到大部分内存都不在报告的内存中.

I noticed something odd in the Memory inspector of both Chrome and Firefox. On a large page, it will tell you how much various JavaScript objects take up, but doesn't seem to list any image/multimedia objects. In fact, in this screenshot taking from the Profiles panel in Chrome's DevTools you can see most of the memory isn't in what it reported.

(您甚至可以在此页面上看到此信息,转到配置文件"->获取堆快照",然后从顶部下拉列表中选择统计信息".)

(You can see this even on this page, going to Profiles -> Take Heap Snapshot, selecting Statistics from the top dropdown.)

有没有更合适的方法来查看对象使用了多少内存?尤其是在Firefox中-我问是因为最近我注意到一个JavaScript配置文件,而垃圾收集在页面加载期间花费了很长时间.

Is there a more proper way to see how much memory is used by objects? Especially in Firefox - I ask because I had recently noticed a JavaScript profile and garbage collection took a very long time during page load.

推荐答案

在Firefox中,按 Ctrl + Shift + I 打开开发人员工具.选择内存标签.检查或选择可用选项,例如,记录分配堆栈视图:支配者标签依据:类型.点击拍摄快照,然后滚动以查看保留大小(字节)浅大小(字节)标签 >对象.

In Firefox press Ctrl+Shift+I to open the Developer Tools. Select the Memory tab. Check or select the available options, for example, Record allocation stacks, View: Dominators, Label by: Type. Click Take snapshot and scroll to review the Retained Size (Bytes), the Shallow Size (Bytes) and the Label of objects.

另请参见如何来检测触发JavaScript中垃圾回收的内存分配? 查看全文

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