Explaining the difference between inline and heap memory in Javascript

I am debugging a Javascript application using too much memory. In the Heap Profiler, it says 300MB, but according to the Chrome Task Manager, it uses about 950MB, with 40MB of "Javascript Memory".

It looks like the difference between Task Manager and the 650MB Heap Profiler has to do with native memory based on this question:

Chrome Heap snapshot - Why doesn't it display all allocated memory?

However, I can't figure out what "native memory" is, and googling didn't help. What types of things go into onboard memory and how can I debug something that uses so much of its own memory?

Possible duplicates (all unanswered):

Heap Profiler Reports and Task Manager Reports: Who to Trust?

Huge difference between memory usage shown in chrome task manager and memory timeline

+3


source to share


1 answer


I won't give my hand for this, but I suppose native memory is all chrome memory backups for a javascript task. This is why it shows up in the Task Manager. On the other hand, heap memory contains all objects that are allocated by the javascript task. When such an object is no longer referenced, it can be flushed from the heap by the garbage collector. If your javascript task is collecting more and more heaps, you may have leaks in your code. The heap profiler can support you in detecting memory leaks, but in general, take care of referencing all of your objects when writing any code.



0


source







All Articles