/vue3-ssr-test

some test case for vue3-ssr

Primary LanguageJavaScript

Vue SSR memory leak when error occur

how to reproduce ?

env: Node 10.22.0

source: in src fold

bundle code: bundle_error.js, bundle_success.js

test code: test_success.js, test_error.js

First of all, install dependencies: npm install

run error test: node test_error

What is actually happening?

you can see the result is like this:

error

one snapshot of blockStack is like this :

error_debug_info

The problem is : blockStack grows every time it is executed, blockStack is not freed when something error occur.

What is expected?

blockStack should be cleared.

Other info

we can see the success case, in this case, "we add data to btnPro", like this:

app

and then , run success test: node test_success, we can see the result is like this: error

one snapshot of blockStack is like this:

success_debug_info

we can see the length of blockStack is always zero when function closeBlock is called, and the memory behaving normally.

Question

Is this is a bug ? If so, Maybe we need an method like clearBlockStack so that we can free the blockStack in time when some error occur. If not, we would be very grateful if you tell us how to solve this problem. At last, Thanks for reading this issue. :)