vuejs / devtools-v6

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools-v6.vuejs.org/
MIT License
24.68k stars 4.14k forks source link

Memory leak in the Timeline #2187

Open star-ll opened 2 months ago

star-ll commented 2 months ago

What problem does this feature solve?

issue

vue-devtools version is 6.5.1

By analyzing the browser's memory tools leads to this conclusion window.__vdevtools_ctx has a memory leak

image

image

image

By analyzing the execution stack, it can be determined that the memory leak is due to timeline tab. When devtool starts, the timeline will automatically record vuex events and make a deep copy of the state(it is stored in window.__vdevtools_ctx.timelineEventMap), which, if the state is large and frequently modified, will cause the memory footprint to keep growing and not be freed up.

proposal

Add a button to start record in timeline tab, instead of automatically starting record event.