Chrome堆堆快照 - 为什么它不显示所有分配的内存? [英] Chrome Heap Snapshot - Why it doesn't show all the memory allocated?

查看:399
本文介绍了Chrome堆堆快照 - 为什么它不显示所有分配的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在WebGL项目中运行一些内存使用测试。如果我在谷歌浏览器上启动页面并在开发人员工具的配置文件选项卡上创建堆快照,它会说我的页面持有7.5 MB。



问题是如果我查看任务管理器,它使用的实际价值差不多是1 GB!因为我真的迫使页面有成千上万的对象,但问题是:为什么Chrome向我显示我只用了7.5 MB?

解决方案

更新



本机内存快照能够向您显示本机内存图。
不幸的是我们删除了它,因为它是一段脆弱的代码。
它需要数百个类中的非平凡工具,并影响二进制大小。
我希望稍后重新实现它。
$ b

拍摄Javascript堆的快照。所有的JavaScript对象都使用7.5MB。此大小不包括图像,画布,音频文件,插件数据等。



DevTools中有本机内存快照。
它计算渲染器进程使用的非JavaScript内存,但这是一个实验性功能。



您需要在 chrome:// flags ,重新启动浏览器,在DevTools设置面板中启用Native Memory Profiler实验性功能,然后重新打开DevTools。



您可以在Profiler面板中使用本机内存快照。
本地内存堆中的所有内存块都不计算在内,但我们正在处理这些内存块。



请使用加纳利Chrome版本
它每天更新并与其他版本的Chrome并行工作。



如果您的页面消耗了千兆字节的内存并且有大的其他栏,超过10%-20%,请将相关邮件发送到 Google Chrome Developer Tools Foums


I'm running some memory usage tests in a WebGL project that I have. If I start the page on Google Chrome and take a heap snapshot on the Profiles tab of Developers Tool, it will say that my page is holding 7.5 MB.

The problem is if I look into Task Manager, the real value that it is using is almost 1 GB! It is expected, since I am really forcing the page to have thousands of objects, but the question is: why Chrome shows to me that I am using only 7.5 MB?

解决方案

update

there was native memory snapshot that was able to show you the native memory graph. Unfortunately we removed it because it was a fragile piece of code. It required nontrivial instrumentation in hundreds of classes and affected the binary size. I hope we reimplement it later.

was

It takes a snapshot of Javascript heap. All your javascript objects use 7.5mb. This size doesn't include images, canvases, audio files, plugin data, etc.

There is a native memory snapshot in DevTools. It counts non-javascript memory used by the renderer process but this is an experimental feature.

You need to enable DevTools experimental feature in chrome://flags, restart the browser, enable Native Memory Profiler experimental feature in DevTools settings panel and reopen DevTools.

After all these steps you will be able to take Native Memory Snapshot in Profiler panel. Not all the memory chunks in the native memory heap are counted but we are working on that.

Please use the Canary version of Chrome. It updates every day and works side-by-side with other versions of Chrome.

If your page eats gigabytes of memory and has big "Other" bar, more than 10%-20%, please drop a mail about that to the Google Chrome Developer Tools Foums.

这篇关于Chrome堆堆快照 - 为什么它不显示所有分配的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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