vuetify-nuxt-module icon indicating copy to clipboard operation
vuetify-nuxt-module copied to clipboard

VDialog - Memory Leak with SSR

Open SparkDragon opened this issue 1 year ago • 1 comments

Environment

  • Node : 20.9.0

Packages

  • nuxt: 3.13.2
  • vue: 3.5.11
  • vue-router: 4.4.5
  • vuetify-nuxt-module: 0.18.3
  • vuetify (as dependency of vuetify-nuxt-module): 3.7.2

Description

Using "v-dialog" component causes memory leaks with Nuxt SSR.

Reproduction case

  1. Create a new nuxt project: yarn dlx nuxi@latest init test
  2. Add vuetify-nuxt-module: yarn nuxi@latest module add vuetify-nuxt-module
  3. Edit app.vue content:
<template>
  <div>
    <NuxtRouteAnnouncer />
    <NuxtWelcome />
    <v-dialog v-model="open">
      Hello world!
    </v-dialog>
  </div>
</template>

<script setup lang="ts">
  const open = ref(true);
</script>
  1. Build the application: yarn build
  2. Run with inspector: node --expose-gc --inspect .output/server/index.mjs
  3. Go to http://localhost:3000 with Google Chrome
  4. Open dev console (F12)
  5. Click on the node icon "Open dedicated DevTools for Node.js" on the top of the DevTools
  6. Take a snapshot
  7. Reload the page multiple times (10 times in my case) and wait a moment to let Nuxt clear memory
  8. Take a snapshot and compare with previous one

The property "Object" went from 4 846 852 bytes to 7 564 180 bytes and I can see there are a lot of new "v-dialog" objects which are not deleted. The more I wait, the more there are new "v-dialog" in memory (even without refreshing the page). After several minutes, it was more than 20 Mbytes.

Here is a screenshot of the snapshot. image

I've created a new project to isolate the issue, but I encountered the same problem with a real app, and with other vuetify components.

Any idea ?

SparkDragon avatar Oct 10 '24 09:10 SparkDragon