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

Heap Usage seems a little high eh? #22

Open
coininstant opened this issue Jan 1, 2024 · 3 comments
Open

Heap Usage seems a little high eh? #22

coininstant opened this issue Jan 1, 2024 · 3 comments

Comments

@coininstant
Copy link

coininstant commented Jan 1, 2024

I have my version running at heliosmarket.io, however, I noticed high heap usage.

high-heap
@Huguesmmm
Copy link

My build failed because of high heap usage on railway. I still don't know how to fix this issues

@coininstant
Copy link
Author

I didn't have any issue running mine on railway, but I do recall needing this flag for building mine on amazon aws: you could try adding --max-old-space-size=4096 dist/server.js" to your package.json to see if that helps.
below is an example of where to place the line, my setup may be a little different, so be sure to paste the flag into your package.json carefully.

"scripts": {
"dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts nodemon",
"generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types",
"build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload build",
"build:server": "tsc --project tsconfig.server.json",
"build:next": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NEXT_BUILD=true node --max-old-space-size=4096 dist/server.js",
"build": "cross-env NODE_ENV=production yarn build:payload && yarn build:server && yarn copyfiles && yarn build:next",
"start": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node --max-old-space-size=4096 dist/server.js",
"copyfiles": "copyfiles -u 1 "src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}" dist/",
"lint": "next lint"
}

@Acc3ssD3ni3d
Copy link

I didn't have any issue running mine on railway, but I do recall needing this flag for building mine on amazon aws: you could try adding --max-old-space-size=4096 dist/server.js" to your package.json to see if that helps. below is an example of where to place the line, my setup may be a little different, so be sure to paste the flag into your package.json carefully.

"scripts": { "dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts nodemon", "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types", "build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload build", "build:server": "tsc --project tsconfig.server.json", "build:next": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NEXT_BUILD=true node --max-old-space-size=4096 dist/server.js", "build": "cross-env NODE_ENV=production yarn build:payload && yarn build:server && yarn copyfiles && yarn build:next", "start": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node --max-old-space-size=4096 dist/server.js", "copyfiles": "copyfiles -u 1 "src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}" dist/", "lint": "next lint" }

Hey bro did u deploy on vercel if yes is it working

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

3 participants