Skip to content

levchak0910/vue-ssr-computed-memory-leak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vue SSR memory leak when using computed

Steps to reproduce

For nuxt

cd nuxt
yarn install
yarn c # build app; run server in production mode; make performance test

Result - memory leak: constant increasing in tab "Memory Usage"
n1

After test move to /nuxt/Post.vue and change

- <!-- <mark v-if="post.userId === 1">1</mark> -->
- <mark v-if="isFirstUser">1</mark>
+ <mark v-if="post.userId === 1">1</mark>
+ <!-- <mark v-if="isFirstUser">1</mark> -->
yarn c # run the test again

Result - no memory leak: approximate usage of memory around 200Mb (after huge jump to 1Gb, maybe some nuxt stuff) n2

For vite

cd vite
yarn install
yarn c # build app; run server in production mode; make performance test

Result - memory leak: constant increasing in tab "Memory Usage"
v1

After test move to /vite/src/Post.vue and change

- <!-- <mark v-if="post.userId === 1">1</mark> -->
- <mark v-if="isFirstUser">1</mark>
+ <mark v-if="post.userId === 1">1</mark>
+ <!-- <mark v-if="isFirstUser">1</mark> -->
yarn c # run the test again

Result - no memory leak: approximate usage of memory around 150Mb v2