Redocly / Redocly/redoc

JavaScript heap out of memory and/or coredump

Open
#2,383 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

Describe the bug
Redocly cli crash on docker and bare metal (node 18.16.1-1, node 20.4.0).

Expected behavior
Generated documentation.

Minimal reproducible OpenAPI snippet(if possible)
1.
docker run --rm -p 80:80 dockware/play:latest

wget -O shopware-admin-openapi3.json http://localhost/api/_info/openapi3.json?type=jsonapi

docker run --rm -v ./:/spec redocly/cli build-docs shopware-admin-openapi3.json

--> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

docker run --rm -v ./:/spec --env NODE_OPTIONS=--max_old_space_size=32000 redocly/cli build-docs shopware-admin-openapi3.json

--> ~18GB memory used --> coredump

Screenshots

redocly-coredump

htop-1

Additional context

on bare metal:
redocly lint shopware-admin-openapi3.json
...
Woohoo! Your OpenAPI definition is valid. 🎉
You have 76 warnings.

npm list -g
/usr/lib
└── @redocly/cli@1.0.0-rc.2

this is default and minimal schema for shopware https://github.com/shopware/platform/

shopware-admin-openapi3.json.zip

logs.log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the listed redocly/cli build-docs command with shopware-admin-openapi3.json and review logs.log alongside the attached reproduction steps. Compare the normal run with the NODE_OPTIONS run; done means the OpenAPI definition produces documentation without reaching the JavaScript heap limit or causing a coredump.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, node.js, openapi, typescript
Domain
cli, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.