Javascript Chrome DevTools:在潜在的内存不足崩溃之前暂停

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42110726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 00:54:45  来源:igfitidea点击:

Chrome DevTools: paused before potential out-of-memory crash

javascriptgoogle-chromegoogle-chrome-app

提问by Pawe? Pszty?

In latest Chrome DevTools I can see a new information:

在最新的 Chrome DevTools 中,我可以看到一个新信息:

enter image description here

在此处输入图片说明

Now, I'm not sure how to use this information. It seems to appear randomly in the app. How can I debug the app to avoid potential out-of-memory crashes? I checked in task manager that at the moment when this information appears the app uses about 55K memory which in case of this app is quite low (when it computes some data it can be much higher memory consumption).

现在,我不确定如何使用这些信息。它似乎随机出现在应用程序中。如何调试应用程序以避免潜在的内存不足崩溃?我在任务管理器中检查,在出现此信息时,该应用程序使用大约 55K 内存,在此应用程序的情况下,该内存非常低(当它计算某些数据时,内存消耗可能会高得多)。

So I'm wondering if this information is accurate and there is a risk of crashing. If so, what should I do with it?

所以我想知道这个信息是否准确,是否有崩溃的风险。如果是这样,我该怎么办?

回答by mate.gwozdz

Record a profile with memory tab in chrome dev tools. You can investigate there which functions consume memory

在 chrome 开发工具中使用内存选项卡记录配置文件。您可以在那里调查哪些函数消耗内存

Chrome memory tab

Chrome 内存标签

Here's a great guide: https://developers.google.com/web/tools/chrome-devtools/memory-problems/

这是一个很好的指南:https: //developers.google.com/web/tools/chrome-devtools/memory-problems/

回答by activist

Maybe this is late and very obvious, but you can use the "Memory" tab in the Chrome developer tools to create a memory snapshot while loading/browsing your app in order to investigate what is eating up your memory (given that it actually is your app that is eating up the memory).

也许这很晚而且很明显,但是您可以使用 Chrome 开发人员工具中的“内存”选项卡在加载/浏览您的应用程序时创建内存快照,以调查是什么占用了您的内存(假设它实际上是您的正在消耗内存的应用程序)。