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

Deployment in Fly.io crashes with JavaScript heap out of memory #276

Closed
ivan-navarro-75 opened this issue Mar 29, 2024 · 5 comments · Fixed by #282
Closed

Deployment in Fly.io crashes with JavaScript heap out of memory #276

ivan-navarro-75 opened this issue Mar 29, 2024 · 5 comments · Fixed by #282

Comments

@ivan-navarro-75
Copy link

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

Follow the steps as they're specified here

Expected Behavior

The deployment is completed successfully

Actual Behavior

The following exception is thrown on the Fly.io machine during the prisma migrate deploy

npm WARN exec The following package was not found and will be installed: prisma@5.11.0
2024-03-28T20:12:17.732 app[48e2957c719958] lhr [info] <--- Last few GCs --->
2024-03-28T20:12:17.732 app[48e2957c719958] lhr [info] [322:0x58fe850] 18827 ms: Mark-sweep (reduce) 253.5 (258.2) -> 253.3 (258.7) MB, 639.4 / 0.6 ms (+ 167.1 ms in 31 steps since start of marking, biggest step 18.7 ms, walltime since start of marking 1086 ms) (average mu = 0.480, current mu = 0.426) all[322:0x58fe850] 19812 ms: Mark-sweep (reduce) 254.3 (258.7) -> 254.2 (259.7) MB, 973.0 / 0.0 ms (average mu = 0.289, current mu = 0.013) allocation failure; scavenge might not succeed
2024-03-28T20:12:17.732 app[48e2957c719958] lhr [info] <--- JS stacktrace --->
2024-03-28T20:12:17.732 app[48e2957c719958] lhr [info] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
2024-03-28T20:12:17.743 app[48e2957c719958] lhr [info] 1: 0xb9a300 node::Abort() [npm exec prisma migrate deploy]
2024-03-28T20:12:17.743 app[48e2957c719958] lhr [info] 2: 0xaa0794 [npm exec prisma migrate deploy]

The solution is to scale the machine memory to 1024

fly scale memory 1024

Which is a bit frustrating as this memory is only going to be needed during deployment.

@hernanponcetta
Copy link

I'm encountering the same error when attempting to deploy to Fly.io. The same app, with the same configuration, was deployed successfully last week. Not sure if this is Remix-related.

@ivan-navarro-75
Copy link
Author

wasn't this creation of swap space intended to avoid this problem? why did it stop working? these are my major doubts here

@julianosirtori
Copy link

julianosirtori commented Apr 4, 2024

I have the same issue, last week worked fine

I scaled the machine memory and works for me too.

fly scale memory 1024

@MichaelDeBoey
Copy link
Member

CC/ @rubys

@benwaffle
Copy link

benwaffle commented Apr 22, 2024

Swap space now has to be set via the swap_size_mb option in fly.toml - https://fly.io/docs/reference/configuration/#swap_size_mb-option

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

Successfully merging a pull request may close this issue.

5 participants