x-data magics patch1
Source Alpine src: /leak2-magic/patch2/patch-inject-cdn.jsNote that this runs with this patch on top of all the previous patch in that branch – adding a cleanup step for injectMagics
.
This is simplest to do with the gc
method exposed in Chrome, e.g. by running it with these flags (alternatively is to manually do GC in Chrome’s memory profiler and then check the content of window.leakDetector
and/or the detached elements in profiler):
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --js-flags="--expose-gc" --enable-memory-info
With your Chrome console open:
- Click the red button.
- Check the content of
leakDetector
(printed to console)
You can also create a new memory profile in Chrome and filter by Detached
elements.
There, you will see detached elements matching the below. If you click on one, it points to el > raw> > targetMap > store ...
and similar.
This means that this still leaks, but differently than in patch1.
This story continues in patch3.