Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript heap out of memory and/or coredump #2383

Open
icesvz opened this issue Jul 19, 2023 · 5 comments
Open

JavaScript heap out of memory and/or coredump #2383

icesvz opened this issue Jul 19, 2023 · 5 comments

Comments

@icesvz
Copy link

icesvz commented Jul 19, 2023

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

@AlexVarchuk AlexVarchuk transferred this issue from Redocly/redoc Jul 19, 2023
@lornajane
Copy link
Contributor

Thanks for letting us know about this. Please check if you have any circular references in your OpenAPI description, and also if you can build the docs on bare metal or if this problem is specific to docker? (note: may be related to #2474 )

@icesvz
Copy link
Author

icesvz commented Jul 27, 2023

Tested on bare metal too (node 18.16.1-1, node 20.4.0) the same problem

@icesvz
Copy link
Author

icesvz commented Jul 28, 2023

Please check if you have any circular references in your OpenAPI description

Is there a method/script to check this?
Maybe an option to ignore these references?

@tatomyr
Copy link
Contributor

tatomyr commented Aug 7, 2023

You can run redocly bundle openapi.json --dereferenced --output bundled.json. If your definition contains circular dependencies, it will bark at you. (Spoiler, there are).
However, I'm not sure this is the only issue here. Looks like there is something with React building a document on the server side.

@tatomyr
Copy link
Contributor

tatomyr commented Aug 11, 2023

I'm transferring it back since the issue is on Redoc / Reference Docs side.
cc @AlexVarchuk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants