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

Component MenuItem Seems to Have Either a Memory Leak or Significant Performance Issues #2356

Closed
zoominGiladSher opened this issue Jul 14, 2023 · 2 comments

Comments

@zoominGiladSher
Copy link

Describe the bug
We have an OpenAPI spec that is ~800KB (see attached). When trying to load it with the RedocStandalone component we're getting a long loading icon that then crashes the tab. Other smaller specs do not have the same problem. While trying to debug this I've noticed that each rendered MenuItem component seems to increase the memory usage by 10's of MB. This seems like a bug in the library implementation and is incredibly difficult to debug locally because of the minified files. In the video and screenshots below you can see the memory utilization of the tab after each render cycle (bottom left corner - JS heap size

I'm unsure what is the root cause of this but it might be related to #696 which has been open for 5 years... I would really appreciate your response and investigation on this.

Expected behavior
Memory usage of the library - even for large configurations - should not be gigabytes of memory.

Minimal reproducible OpenAPI snippet(if possible)
reproduction.zip

Screenshots
https://github.com/Redocly/redoc/assets/56221821/f63db0a1-017c-41e6-b9c8-e999742ac4a7
image
image
image

@adamaltman
Copy link
Member

Hi Gilad, this is expected. The community edition doesn't support pagination. Because of that, there is a practical limit on the size of the OpenAPI definition.

I checked the stats on the API and it's a substantial size:

% redocly stats ~/Downloads/reproduction/SubscribeAPI.yaml

    ╔═══════════════════════════════════════════════════════════╗
    ║                                                           ║
    ║  A new version of Redocly CLI (1.0.0-rc.1) is available.  ║
    ║  Update now: `npm i -g @redocly/cli@latest`.              ║
    ║  Changelog: https://redocly.com/docs/cli/changelog/       ║
    ║                                                           ║
    ╚═══════════════════════════════════════════════════════════╝
  Document: /Users/adam/Downloads/reproduction/SubscribeAPI.yaml stats:

🚗 References: 155
📦 External Documents: 0
📈 Schemas: 122
👉 Parameters: 106
🔗 Links: 0
➡️  Path Items: 90
👷 Operations: 131
🔖 Tags: 29

Also, curiously, the API example belongs to Vindicia? Are you contacting us on their behalf?

@zoominGiladSher
Copy link
Author

Hi Adam, do you have an exact number for the limit of the definition that I could share with our stakeholders? They might be willing to pay for the paid version of Redoc if I can give them the limitations and compare that with the pricing of the product.
The API example does belong to Vindicia, I am contacting on their behalf but as an engineer of Zoomin.
Thank you for your answer regardless!

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

2 participants