Skip to content

Memory consumption / scalability issues #1025

@Gijsdeman

Description

@Gijsdeman

Describe the bug

On our current platform, we generate documentation using this generator. However, both with previous versions, as well as with the canary version using @docusaurus/faster, the memory consumption for building the documentation with generated OpenAPI documentation is significant.

When building documentation without the generated files, the total memory consumption is around 500m. When I include the generated files, at first, the memory consumption stays the same. However, it seems that when the css-loader step kicks in, that memory consumption skyrockets to 2.5g, increasing all the way to 3.5g until the end of the build. This is quite significant for 244 files.

When removing the actual contents of the generated files (that is, only including the front matter), the memory consumption peaks around 1g, which is more along the lines of what I expect.

Expected behavior

The documentation to build without a big increase in memory consumption.

Current behavior

During build (for as it seems, when reaching the css-loader step) the memory usage jumps to 2.5g and slowly rises to 3.5g until the build finishes.

Possible solution

For now, I do not know. I am willing to look into this issue to see if there are any ways to reduce required memory.

Steps to reproduce

  1. Take a relatively large openapi specification file.
  2. Follow the README to generate documentation for these specs. In my instance, I generated 244 files.
  3. Build the documentation in, for example, a Docker container to monitor the memory usage.

Screenshots

Start of the build:
specs-start

After sudden jump in memory usage:
specs-middle

At the end of the build:
specs-end

Context

When building documentation in Docker containers, I want to restrict memory usage as the memory on the server is shared by various other containers. In case the build takes up too much memory, this will hinder other services/builds.

Your Environment

  • Version used: canary
  • Environment name and version: node 18
  • Operating System and version (desktop or mobile): node:18-alpine (Docker)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions