Memory leak when using reactive/ref in SSR mode
Version
3.2.31
Reproduction link
Steps to reproduce
- download repository
- using
npm run serve
to start the server - see reactiveMap in the dist/server/entry-server folder
What is expected?
reactiveMap should be empty in server SSR
What is actually happening?
reactiveMap is expanding
This issue is similar to #5208
I didn't find any other variable to tell if it's currently server-rendered(maybe window === undefined?)
So is it possible to build a branch for SSR? (I see there is a __SSR__ variable in the source code)
Or other solutions, thx
We'll need a bit more info to confirm that this is indeed a memory leak - reactiveMap
is a WeakMap - which means an entry can be released if its key is no longer referenced anywhere.
Your console.log()
may cause the console to iterate the WeakMap and thus prevent all keys to be released.
To show a memory leak, please provide a repro similar to that of #5208.