Environment
- Operating System: Linux (Google Cloud Run)
- Node Version: v24
- nuxt/cli version: 3.32.0
- Package manager: npm
- Nuxt Version: 4.2.2
- Nitro Version: 2.12.9
- Builder: vite 7.3.0
- Config: $development, $env, $production, app, compatibilityDate, components, content, css, devServer, devtools, eslint, experimental, image, modules, nitro, pages, routeRules, runtimeConfig, scripts, typescript, vite
- Modules: @vueuse/nuxt 14.1.0, @nuxt/image 2.0.0, @nuxtjs/tailwindcss 6.14.0, @nuxt/test-utils/module 3.20.1, @nuxt/content 3.8.0, @nuxt/eslint 1.10.0, @nuxt/scripts 0.13.1, @nuxt/icon 2.1.0
Reproduction
Cannot provide minimal reproduction - occurs only in production SSR under real traffic.
Describe the bug
Continuous memory leak in Nuxt 4.2.2 SSR application. Memory grows until OOM crash.
Additional context
Heap Profile Comparison (Before vs After ~6 hours of traffic)
| Function |
Before |
After |
Growth |
replace |
18.19 MiB |
166.1 MiB |
9.1x |
destr |
10.86 MiB |
104.5 MiB |
9.6x |
normalizePropsOpt |
5.215 MiB |
46.29 MiB |
8.9x |
_parse |
2.857 MiB |
42.93 MiB |
15x |
tokensToParser |
1.715 MiB |
31.18 MiB |
18x |
tokenizePath |
2 MiB |
17.39 MiB |
8.7x |
useAsyncData |
N/A |
27.25 MiB |
new |
useFetch |
N/A |
14.22 MiB |
new |
addRoute |
N/A |
11.5 MiB |
new |
Total heap: ~111 MiB → ~843 MiB (7.6x growth)
Key Observations
- Vue Router shows highest growth -
tokensToParser increased 18x
- Data fetching accumulates -
useAsyncData/useFetch only appear after growth
- All functions grow proportionally - indicates entire SSR context is not being released
What we've tried
- Audited all application code for module-scope state leaks
- Verified no module-scope
useNuxtApp(), useRoute() calls
- No improvement from application-side fixes
Logs
Environment
Reproduction
Cannot provide minimal reproduction - occurs only in production SSR under real traffic.
Describe the bug
Continuous memory leak in Nuxt 4.2.2 SSR application. Memory grows until OOM crash.
Additional context
Heap Profile Comparison (Before vs After ~6 hours of traffic)
replacedestrnormalizePropsOpt_parsetokensToParsertokenizePathuseAsyncDatauseFetchaddRouteTotal heap: ~111 MiB → ~843 MiB (7.6x growth)
Key Observations
tokensToParserincreased 18xuseAsyncData/useFetchonly appear after growthWhat we've tried
useNuxtApp(),useRoute()callsLogs