最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is this js heap graph worrying? How can I fix it? - Stack Overflow

programmeradmin3浏览0评论

I have recorded the performances of an angular 4.4 app and I think that what the Chrome dev tools returned me about the js heap could be worrying, but I honestly lack on this subject.

I don't understand the straight drop at ~20000ms, the straight line soon after and the other drop at ~60000ms: what are they due to? Are those behaviours normal or do they means that something should be fixed?

I have recorded the performances of an angular 4.4 app and I think that what the Chrome dev tools returned me about the js heap could be worrying, but I honestly lack on this subject.

I don't understand the straight drop at ~20000ms, the straight line soon after and the other drop at ~60000ms: what are they due to? Are those behaviours normal or do they means that something should be fixed?

Share Improve this question edited Sep 20, 2017 at 8:17 Nad G asked Sep 19, 2017 at 15:47 Nad GNad G 5172 gold badges10 silver badges21 bronze badges 6
  • 1 What specifically is alarming you? – guest271314 Commented Sep 19, 2017 at 15:55
  • The drop at ~20000ms, the streight line soon after and then the increase worry me. Do you know what they are due to? – Nad G Commented Sep 19, 2017 at 15:59
  • From the image provided at OP it appears that a procedure is called based on a timer? When the procedure is called processes are menced. Still not certain why your own code would be alarming to you? You should know better than viewers of the image what is occurring with your code. See stackoverflow./help/mcve – guest271314 Commented Sep 19, 2017 at 16:02
  • Also have a deeper look at stop the world and the V8 event loop ... – Jonas Wilms Commented Sep 19, 2017 at 17:06
  • 1 In the scope of SO it is not really possible to tell if it is a problem or not. The drop just means that some task that allocated certain amount of memory finished, and this memory was released. This is perfectly fine if all that memory was required up to the end of the task, but it also could indicated that you had a closure that preserved certain objects/memory over the whole time even if you didn't use it anymore. – t.niese Commented Sep 20, 2017 at 8:34
 |  Show 1 more ment

1 Answer 1

Reset to default 16

The incline means that the page was allocating memory in the JS heap. This is normal.

The drops mean that the browser freed up memory in the JS heap that was no longer needed. This is called garbage collection. That's normal, too. Nothing alarming about that.

In general, if you see that the total amount of memory is progressively increasing after each garbage collection event, then that's a warning sign that you have a memory leak. The memory leak pattern usually looks like this:

Source

As you can see from the graph, if you leave the page running for long enough, eventually it will use up all of the puter's memory, causing the puter to run slowly, or crash.

See Fix Memory Problems for more techniques for analyzing memory usage.

发布评论

评论列表(0)

  1. 暂无评论