Skip to content
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 grow with rollup 3.19 #4904

Closed
Mister-Hope opened this issue Mar 15, 2023 · 16 comments · Fixed by #4938
Closed

Memory grow with rollup 3.19 #4904

Mister-Hope opened this issue Mar 15, 2023 · 16 comments · Fixed by #4938

Comments

@Mister-Hope
Copy link

Mister-Hope commented Mar 15, 2023

Rollup Version

3.19.1

Operating System (or Browser)

Ubuntu 22.04 (WSL)

Node Version (if applicable)

18.15.0

Link To Reproduction

vuepress-theme-hope/vuepress-theme-hope#2906

(vuepress-theme-hope/vuepress-theme-hope@f1beda0 is working fine)

Expected Behaviour

I am expecting Rollup can build.

All project using vite (which relies on rollup) run out of memory

I believe rollup have memory leak because webpack actually takes more memory comparing with vite, but all vite ci blows with rollup changing from 3.18.0 to 3.19.1.

If rollup itself runs well all time, perhaps vite can not handle rollup change? Anyway, I hope someone can check why the memory is increasing in my case (At least > 300MB with the version change)

Actual Behaviour

Run out of memory.

@kachurun
Copy link

kachurun commented Mar 15, 2023

I have the same issue with 3.18

Screenshot 2023-03-15 at 14 18 06

My build accidentally fails sometimes because node process out of memory (2gb). For sure I can increase limit for node, but I didn't have any problems until update to v3 branch.

@lukastaegert
Copy link
Member

There was additional analysis added in 3.19.0 that might explain a moderate increase in memory consumption.

@Mister-Hope
Copy link
Author

Mister-Hope commented Mar 15, 2023

There was additional analysis added in 3.19.0 that might explain a moderate increase in memory consumption.

Thanks for the reply, but I think the additional analysis take no less than 15% extra memory. Can we get a chance to see if we can optimize it? I am kind of disappointed whenI found out 2GB is not enough for my “demo projects”

@cpauwels
Copy link

I also have what I believe is a related issue with building all my Nuxt projects (Related issue: unjs/nitro#1063)

@lukastaegert
Copy link
Member

A maximum call stack exceeded error looks like an actual bug in Rollup. If we can have a reproduction for the issue, even a complicated one, then I can have a look.

@warflash
Copy link

Hey @lukastaegert in case you're still looking for a reproduction there's this issue over on nuxt nuxt/nuxt#19824 containing a repro + CI logs

@lukastaegert
Copy link
Member

I am looking for a reproduction for “Maximum call stack size exceeded”, not “JavaScript heap out of memory”. Those are very different problems.

@RadiumAg
Copy link

Me too, I restore to "rollup 3.10.0" that resolve this problems

@hi-reeve
Copy link

does this solved with the latest version?

@kalvenschraut
Copy link

nuxt/nuxt#19783 (comment) @lukastaegert

Looks like a nuxt user was able to figure out a repo in his comment for the callstack error. Found it after digging into myself why I was getting this issue and seems to point to rollup 3.19 as with rollup at 3.18, my build succeeds with no error.

@Darkmift
Copy link

Darkmift commented Apr 5, 2023

I believe I am experiening a similar/related issue

sharing this log in hope it might help
my build fails and trying rn to reproduce witha blank project...will update this message asap

Edit:

The issue is NOT RELATED TO ROLLUP!

I had an issue with another library (@vueuse/core) where useTimeago caused it....instead using formattedtimeago.
hope my suffering will help others :)

Maximum call stack size exceeded
error during build:
RangeError: Maximum call stack size exceeded
    at ObjectEntity.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:6043:43)
    at FunctionExpression.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:8597:36)
    at FunctionExpression.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:8973:15)
    at ParameterVariable.addEntityToBeDeoptimized (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:6779:20)
    at FunctionExpression.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:8589:45)
    at FunctionExpression.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:8973:15)
    at ParameterVariable.addEntityToBeDeoptimized (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:6779:20)
    at FunctionExpression.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:8589:45)
    at FunctionExpression.deoptimizeArgumentsOnInteractionAtPath (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:8973:15)
    at ParameterVariable.addEntityToBeDeoptimized (file:///***/client/node_modules/rollup/dist/es/shared/node-entry.js:6779:20)

@danielroe
Copy link
Contributor

From what I can tell, the issue seems to be caused by #4892.

Here are two stackblitzes:

You can update the resolution to just 3.19.0 to reproduce the issue, if that's helpful to narrow down the issue.

@RadiumAg
Copy link

From what I can tell, the issue seems to be caused by #4892.

Here are two stackblitzes:

You can update the resolution to just 3.19.0 to reproduce the issue, if that's helpful to narrow down the issue.

yes, you are right

@lukastaegert
Copy link
Member

I created #4938 to improve the situation, feedback welcome.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4938 as part of rollup@3.20.3-0. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.20.3-0 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4938 as part of rollup@3.20.3. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.