[nestjs] nest build 시 JavaScript heap out of memory

Edward Hyun·2022년 9월 21일
0

backend

목록 보기
96/120

I just faced same problem with my EC2 instance t2.micro which has 1 GB memory.
I resolved the problem by creating swap file using this (https://aws.amazon.com/ko/premiumsupport/knowledge-center/ec2-memory-swap-file/) and set following environment variable.

export NODE_OPTIONS=--max_old_space_size=4096

출처)
https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory
리눅스 스왑 파티션 생성 및 삭제하기
https://willseungh0.tistory.com/13
https://aws.amazon.com/ko/premiumsupport/knowledge-center/ec2-memory-swap-file/

profile
앱&웹개발(flutter, vuejs, typescript, react), 인공지능(nlp, asr, rl), 백엔드(nodejs, flask, golang, grpc, webrtc, aws, msa, nft, spring cloud, nest.js), 함수형 프로그래밍(scala, erlang)을 공부하며 정리합니다.

0개의 댓글