redocusaurus icon indicating copy to clipboard operation
redocusaurus copied to clipboard

Memory regeneration problem when generating with cyclic dependencies

Open DrBronsy opened this issue 2 years ago • 6 comments

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

DrBronsy avatar Jul 05 '23 10:07 DrBronsy

Probably caused by https://github.com/Redocly/redoc/issues/696

stv0g avatar Sep 19 '23 14:09 stv0g

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

rohit-gohri avatar Sep 20 '23 21:09 rohit-gohri

@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.

mason-at-pieces avatar Mar 06 '24 02:03 mason-at-pieces

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

Might be related to redoc issue - https://github.com/Redocly/redoc/issues/2383

rohit-gohri avatar Mar 07 '24 22:03 rohit-gohri

@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 avatar Mar 08 '24 22:03 mason-at-pieces

@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.

mason-at-pieces avatar Mar 11 '24 22:03 mason-at-pieces