Skip to content

Out of memory when building NextJS application with sentry #13836

Open
@ricardomatias

Description

@ricardomatias

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

npx @sentry/wizard@latest -i nextjs

All options for enhancements were marked as off.

Expected Result

That I can build the NextJS application. This is happening in a VPS from Hetzner with 4 vCPUs and 8gb ram.

Actual Result

> build
> next build

  ▲ Next.js 14.2.12
  - Environments: .env.production
  - Experiments (use with caution):
    · instrumentationHook

   Creating an optimized production build ...

<--- Last few GCs --->

[25731:0x5d24710]    90147 ms: Scavenge (reduce) 2040.5 (2073.9) -> 2039.8 (2074.1) MB, 2.69 / 0.00 ms  (average mu = 0.125, current mu = 0.002) allocation failure;
[25731:0x5d24710]    91060 ms: Mark-Compact (reduce) 2040.6 (2074.1) -> 2040.0 (2074.4) MB, 911.94 / 0.00 ms  (average mu = 0.090, current mu = 0.055) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xb82d33 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
 2: 0xef0c50 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 3: 0xef0f37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
 4: 0x1102ad5  [node]
 5: 0x1103064 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 6: 0x1119f54 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [node]
 7: 0x111a76c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 8: 0x10f0a71 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0x10f1c05 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0x10cf256 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x152b086 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x7d341bcd9ef6
Aborted (core dumped)

Product Area

Unknown

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions