Javascript off-heap memory leak identification

I am debugging a memory leak in a complex Javascript application (hundreds of files and almost a million lines of code). It's a game, so it makes heavy use of PNG graphics and 2d canvas.

When profiling memory with Chrome dev tools, I don't see big changes in heap allocation, but memory usage in Chrome Task Manager continues to rise. In fact, GPU memory plus JS memory is only half of the total memory. How can I debug where the rest of this memory goes?

+3


source to share


2 answers


In very many cases, a leak in native memory has a leaked object in js memory. Therefore, with a very high probability, after fixing all js leaks in your application, you will not have leaks in your own memory.



See the answer JavaScript Memory Leak Tracking Tool

0


source


The dom nodes take up on-board memory directly, hence the top nodes exceed memory consumption. Also, since you mentioned that there are a lot of graphics, you need to consider that the image displayed in the tag <img>

takes up additional internal memory, and this is usually more than the original image size.



Ever since the year you have asked this question, if you have probably solved your problem you can write your solutions for others here.

0


source







All Articles