Skip to content

3.3.x causes memory leak #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dongnaebi opened this issue Jan 13, 2024 · 3 comments
Closed

3.3.x causes memory leak #43

dongnaebi opened this issue Jan 13, 2024 · 3 comments

Comments

@dongnaebi
Copy link

Describe the bug

I used nuxt-schema-org in production, which caused my server to crash every 6 hours. After debugging (running stress tests on my computer), I found that just adding nuxt-schema-org to nuxt.config.ts would cause memory to keep increasing, even if I didn't call any APIs.

I tried downgrading to version 3.2.3 and the problem was fixed, but 3.2.3 doesn't have the default configurations defineWebSite and defineWebPage.

I've now deployed 3.2.3 to the production server. It's been over 6 hours and memory has been very stable, whereas before it kept increasing.

I'm not sure how to reproduce this. I built locally and then used pm2 to run locally before running stress tests:

ab -n 3000 -c 100 http://localhost:3000/

Reproduction

No response

System / Nuxt Info

System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11600KF @ 3.90GHz
    Memory: 1.90 GB / 15.84 GB
  Binaries:
    Node: 18.19.0 - ~\.nvmd\versions\18.19.0\node.EXE
    npm: 10.2.3 - ~\.nvmd\versions\18.19.0\npm.CMD
    pnpm: 8.12.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (120.0.2210.133)
    Internet Explorer: 11.0.22621.1
@harlan-zw
Copy link
Owner

Thank you for the issue, I'll need some time to investigate this properly but will do my best to ensure there's no memory leak present.

For the time being, if you want to use the latest version you can disable the defaults with

export default defineNuxtConfig({
  schemaOrg: {
    defaults: false,
  }
})

@harlan-zw
Copy link
Owner

The schema.org is injected using Unhead so likely an upstream issue (related: unjs/unhead#281 (comment))

@harlan-zw
Copy link
Owner

Let's track upstream.

@harlan-zw harlan-zw closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants