Skip to content

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #28233

@Ranjit-Khanal

Description

@Ranjit-Khanal

Bug Report: Node.js Heap Out of Memory on NestJS Startup

Issue Summary

Running yarn start or yarn dev in the @calcom/api-v2 monorepo causes Node.js to crash with a “JavaScript heap out of memory” error. This occurs because the NestJS app loads multiple workspaces and libraries simultaneously, which exceeds the default Node memory limit (~2 GB).


Steps to Reproduce

  1. Clone the repository and run yarn install to install dependencies.
  2. Run yarn start or yarn dev:no-docker.
  3. Wait for the NestJS application to start building all workspaces.

Additional Context:

  • The repo is a monorepo with multiple workspaces (@calcom/platform-libraries, @calcom/platform-utils, etc.) and a TRPC server.
  • Even on a machine with 16 GB RAM, Node’s default heap crashes during startup.

Actual Results

  • Node.js throws the following error:

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

  • The application does not start.

Expected Results

  • The application should start successfully without crashing, allowing development and API testing to proceed.

Technical Details

  • Node.js version: v24.13.0 (via nvm)
  • Yarn version: 1.22.x or 3.x (workspace-enabled)
  • Operating System: Linux (Ubuntu) / macOS
  • Screen recording / console logs show memory allocation failures during NestJS startup.
  • Multiple large TypeScript projects and watch processes are running simultaneously.

Evidence

  • Tested by running yarn start on a machine with 16 GB RAM.
  • Error appears consistently within 30–60 seconds of startup.
  • Observed GC logs in console:

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions