microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.42k stars 2.13k forks source link

azd up not working >> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #959

Open alsiesta opened 6 days ago

alsiesta commented 6 days ago

Describe the bug I want to run azd up and tried in container locally and in codespace.

To Reproduce Steps to reproduce the behavior:

  1. After azd auth login >> Run azd up
  2. See error

tsc && node build

|=======| Packaging service backendvite v4.1.5 building for production... ✓ 2622 modules transformed. |===== | Packaging service backend <--- Last few GCs --->

[13808:0x67fd1b0] 70768 ms: Mark-sweep 4043.2 (4141.1) -> 4042.0 (4141.1) MB, 4055.1 / 0.0 ms (average mu = 0.407, current mu = 0.040) allocation failure scavenge might not succeed [13808:0x67fd1b0] 75875 ms: Mark-sweep 4057.7 (4141.1) -> 4056.6 (4170.8) MB, 5088.5 / 0.0 ms (average mu = 0.206, current mu = 0.004) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 1: 0xb090e0 node::Abort() [node] 2: 0xa1b70e [node] 3: 0xce1a20 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node] 4: 0xce1dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node] 5: 0xe99435 [node] 6: 0xea90fd v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 7: 0xeabdfe v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node] 8: 0xe6d33a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node] 9: 0x11e61e6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [node] 10: 0x15d9e59 [node] |=======| Packaging service backendAborted (core dumped) (x) Failed: Packaging service backend

ERROR: error executing step command 'package --all': failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '134', Path: '/tmp/azd-prepackage-3812507412.sh'. : exit code: 134

Expected behavior The build process should finish

karltb-SAM commented 6 days ago

Hello!

I have also faced the same issue. I've ran $ export NODE_OPTIONS="--max-old-space-size=8192", as is shown in the README. This, however, just leads to the program running out of memory later in the process. Although, it maybe could work for you?

alsiesta commented 6 days ago

I also tried to increase the memory with set NODE_OPTIONS=--max-old-space-size=8192 but it didn't help