-
Notifications
You must be signed in to change notification settings - Fork 32
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
Memory Leak #1089
Comments
Hello @dissy123, Before we talk on the phone ;) Question If this only occurs during installation, it could be due to a dependency that is also installed. {
"@nuxt/image": "0.7.1",
"browserslist-useragent-regexp": "4.1.1",
"deepmerge": "4.3.1",
"defu": "6.1.4",
"dynamic-class-list": "2.0.2",
"pathe": "1.1.2",
"probe-image-size": "7.2.3",
"serialize-to-js": "3.1.2",
"sort-css-media-queries": "2.2.0",
"vue-lazy-hydration": "2.0.0-beta.4"
} Can you perhaps recreate this behavior with one of the specified dependencies? Basically, we only deliver code, and problems may arise with the dependencies in the monorepo. If necessary, even switch from NPM to PNPM, where the monorepo support is better. |
Hello @ThornWalli , So this is how i setup the moduls in my module.ts I checked all the dependencies, i uninstalled all the dependencies, like @nuxt/image and defu which i installed on my own. i am using "nuxt-booster": "^3.1.3" and upgraded nuxt to 3.12.4 The thing is the memory leak only is happening when i build the project for production so with: "pnpm build" When i run with pnpm dev then it is not that big I also tried to test if it works when i install @nuxt/image on my own and deactivate it in nuxt-booster. |
for me it looks like that on each request that is made to the site it is adding around 10 MB to the Node / BackingStore, maybe the payload is always saved for each request? |
How big are your rendered index files? Do you write a lot to the store during generation? |
yes in my store there is the whole website as a json, cause i am building a json to html renderer kind of, so there are really big json files in the store. |
Can you set https://basics.github.io/nuxt-booster/guide/options.html#optimizessr And look again? |
This is just a preparation of a very small video, as base64. But this is then in the main entry. You could reduce the module setup. First comment on everything once and then uncomment on it step by step.
const module = defineNuxtModule({
meta: {
name: "nuxt-booster",
configKey: "booster",
compatibility: {
nuxt: "^3.0.x"
}
},
defaults: getDefaultOptions(),
async setup(moduleOptions, nuxt) {
// const runtimeDir = resolver.resolve("./runtime");
// nuxt.options.alias["#booster"] = runtimeDir;
// nuxt.options.build.transpile.push(runtimeDir);
// deprecationsNotification(moduleOptions);
// await addModules(nuxt, moduleOptions);
// setPublicRuntimeConfig(nuxt, moduleOptions);
// if (moduleOptions.detection.performance && nuxt.options.ssr) {
// if (isWebpackBuild(nuxt)) {
// nuxt.hook(
// "webpack:config",
// registerAppEntry$1(
// resolve(nuxt.options.buildDir, MODULE_NAME, "entry")
// )
// );
// } else {
// nuxt.hook(
// "vite:extend",
// registerAppEntry(
// resolve(nuxt.options.buildDir, MODULE_NAME, "entry.js")
// )
// );
// }
// } else {
// logger.warn(
// "Module functionality is limited without ssr and performance check"
// );
// }
// if (moduleOptions.optimizeSSR) {
// optimizeSSR(moduleOptions, nuxt);
// } else {
// logger.warn(
// "Preload optimization is disabled by module option `optimizeSSR`."
// );
// }
// await addBuildTemplates(nuxt, moduleOptions);
// addImportsDir(resolve(runtimeDir, "composables"));
}
}); There must be a reason somewhere... Have a nice weekend 🙂 |
It happens when importing the BoosterImage Component. When just installing the plugin, then the memory leak is also not there. But if I import the image Component it Leaks. But when i comment this out it works ;) It has todo something with the useHead! I found a few old Articles about a Memory Leak in useHead. But they didn't really help, maybe you have an idea? =) |
Iiiiihhhhhhh 🤮 Let's think about removing the Must think about it 🙂 |
thank you! for helping me out! ;) |
A. Can you set the
And comment the method. It actually only executes useHead() once when the meta has been set. According to console.log.
Question is if maybe the query of the image sizes causes problems. B. Alternatively the test:
The
And replace the setup from
Can't set the I have a suspicion about this position: nuxt-booster/src/tmpl/plugin.tmpl.js Lines 56 to 105 in 76743ec
|
Top problem found... 🙂 I'm preparing a customization 😉 |
thank you ! =) |
Normal, everything is basically very complex 🤪 |
@dissy123 You could try For now, adjust the cache when retrieving the dimensions. |
Good morning,
|
@dissy123 I have added another update. Destroy the requested image with the reuse of nuxt-booster/src/tmpl/plugin.tmpl.js Lines 97 to 103 in 667223c
|
wow updating to next4 removed a lot of RAM again! :-) kind of 10 mb in initial ram usage! |
Close the issue then 🙂 Is now also in the Thank you! |
Describe the bug
I am installing nuxt-booster in a npm package in a monorepository, when i do that i get a memory leak
it is difficult to share a reproduction cause of the complex setup (a lot of custom source code), maybe we can make a call so i can show it to you?
To Reproduce
Steps to reproduce the behavior:
install nuxt-booster
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: