Memory leaks since 3.9.0 version.

On January 3rd we updated Nuxt to 3.9.0 version and since then were suffering from massive memory leaks. Does anybody have any idea what may have caused this? I've tried pretty much everything what could've been done, researched all 3rd party packages for known memory issues, updated everything to newest versions, refactored our own code, but nothing helps. If anybody has any pointers to grab onto, help will be very much appreciated.
No description
10 Replies
Denis Jankelaic
Denis JankelaicOP8mo ago
Update: Memory leak was caused by sentry by creating an instance on server side.
manniL
manniL8mo ago
www.lichter.io
Integrate Sentry with your Nuxt 3 application - A Recipe
Sentry is a great tool to track errors and performance issues in your application - but the Nuxt module is not Nuxt 3 compatible yet. In this article, I'll show you how to integrate Sentry into your Nuxt 3 application, even before the module is ready and also share why it takes longer than you might think to build the module.
Kyllian
Kyllian6mo ago
@Denis Jankelaic sorry for the ping, but we're having this issue too after adding Sentry. How did u fix this?
Denis Jankelaic
Denis JankelaicOP6mo ago
Hello, Sentry should be strictly client sided. Create sentry.client.ts sentry config file in plugins folder, and add it to nuxt.config as below:
plugins: [
'~/plugins/sentry.client.ts'
]
plugins: [
'~/plugins/sentry.client.ts'
]
Romain 'Maz' B.
Romain 'Maz' B.5mo ago
Thanks for this! I am experiencing memory leak issue with a SSR nuxt managed by 4 workers through PM2 so it was 4x700mb memory usage for an app used by 20 users... Can't tell for now if this will fix the issue but sentry was executed on both server & client side.
Denis Jankelaic
Denis JankelaicOP5mo ago
Curious if that fixed your issue?
Romain 'Maz' B.
Romain 'Maz' B.5mo ago
I ran a front-end update few minutes ago so the pm2 processes restarted. Generally I hit 700mb memory usage per process within the day. Here is the screenshot for now, I'll ping you in few hours to see how the memory usage goes
No description
Romain 'Maz' B.
Romain 'Maz' B.5mo ago
@Denis Jankelaic more than 24 hours later, the memory usage is still ok.
No description
Victor Neves
Victor Neves5mo ago
@Denis Jankelaic Sentry can also be for the server
Want results from more Discord servers?
Add your server