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

Memory regeneration problem when generating with cyclic dependencies #300

Open
DrBronsy opened this issue Jul 5, 2023 · 6 comments
Open

Comments

@DrBronsy
Copy link

DrBronsy commented Jul 5, 2023

In the process of using the package on redocusaurus, I encountered the problem of overflowing the available memory when generating a method with cyclic dependencies.

When generating a method with objects interconnected by cyclic dependencies, the process crashes with an Error: Out of memory error. This indicates that the generation is looping, which should not happen when processing circular dependencies.

Play steps:

Create objects with complex relationships (cyclic dependencies).
Try to generate the appropriate method using the redocusaurus package.
Expected Result:
The method with circular dependencies is generated successfully without exceeding the memory limit.

Actual result:
The process crashes with the error Error: Out of memory.

girgab package version: 1.6.3

We would really appreciate your help in solving this problem.

image
@stv0g
Copy link

stv0g commented Sep 19, 2023

Probably caused by Redocly/redoc#696

@rohit-gohri
Copy link
Owner

@DrBronsy Can you share a small reproduction? Some sample schema I can test with

@mason-at-pieces
Copy link

@DrBronsy Running into a similar issue that I've narrowed down to be related to $ref values that are used in the openapi yaml file.

However, there are some $ref values that do work so I'm still narrowing down which actually cause the issue. I'd assume it's some circular dependency.

I wonder if there's anyway to deal with circular dependencies on your end when parsing the file.

@rohit-gohri
Copy link
Owner

@mason-at-pieces can you share any openapi spec that I can use to reproduce the issue?

Might be related to redoc issue - Redocly/redoc#2383

@mason-at-pieces
Copy link

@rohit-gohri I am having a chat with my team about this Monday. I'll get back to you then on this 👍

@mason-at-pieces
Copy link

@rohit-gohri So I downloaded the redocly cli and was able to use both the preview and preview-docs commands just fine. However, the build-docs command is what results in the memory leak.

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

4 participants