Hey guys,
I have a function that:
- parses some JSON
- builds some objects
- then diffs some DOM nodes (50k for testing)
I had a memory leak that I have fixed but for some reason:
-
performance.memory()
logged before and after object creation (not globals) doesn’t show an increase in heap size -
memory -> JS heap snapshot
shows an increase/ decrease in heap size in relation to how many DOM nodes are on the page after the function returns
There are no:
- global objects (except functions);
- event listeners (yet)
- closures
- timing methods
- Dom node ID’s
So I’m wondering:
-
why are objects being pushed to stack memory and not the heap in chrome?
-
why would the “JS” heap reference DOM nodes unless they had ID’s?