-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Javascript runs out of memory when making production build #3604
Comments
Thanks for the report. I'm not sure what we can do to help. Is there a way for a library to tell webpack to increase to available memory (via its package.json I guess)? To help us out, could you provide the underlying webpack command? |
As I said in the original issue, I can increase the heap size to use 8,12,16 gigs ( |
So essentially you're asking us to reduce the size of our I'd recommend instead using our "partial bundles" in your app: https://github.com/plotly/plotly.js/tree/master/dist#partial-bundles for example maybe try using |
Thank you for all the quick responses though ! I think I could use it, but since I am using your react wrapper (React-Plotly.js), I don't know if that package/library has some underlying dependencies on the overall plotly.js library. On NPM, react-plotly.js has plotly.js listed as a dependency. If it does, then I don't know if I can use this solution. |
@arshbhatti8 yes, you can use react-plotly.js with different bundles - see this section of its readme: |
Closing as this ticket won't directly lead to any PRs in this repo. @arshbhatti8 if you any other issues with Thank you! |
@alexcjohnson I related to your comment and found out there is a way to use smaller bundles with react-plotly.js as well using their |
@arshbhatti8 Thank you! |
When I try to build a prod version of my create-react-app (and hence webpack) using npm run build, I get the following error:
<--- Last few GCs --->
[7898:0x104800000] 66632 ms: Mark-sweep 1329.1 (1449.4) -> 1317.7 (1451.4) MB, 564.0 /
0.0 ms (average mu = 0.110, current mu = 0.031) allocation failure scavenge might not succeed
[7898:0x104800000] 67209 ms: Mark-sweep 1331.4 (1451.4) -> 1320.0 (1453.9) MB, 559.9 /
0.0 ms (average mu = 0.072, current mu = 0.030) allocation failure scavenge might not succeed
The production version builds fine when I use
--max_old_space_size=8192
and takes about ~2 mins to build.Here's a sandbox for reference: https://codesandbox.io/s/381yjyn415
I've taken the liberty of adding all the dependencies that I use in my project.
The text was updated successfully, but these errors were encountered: