scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.43k stars 227 forks source link

Memory issue between ~4.1 and ^4.2 #288

Open Darkein opened 2 years ago

Darkein commented 2 years ago

Hi, since version 4.2, the memory used by swagger-ui-express has been multiplied by 3.

An empty nestJS 8 project which only have typeorm uses ~100MB. With swagger-ui-express@~4.1, it uses ~112MB With swagger-ui-express@~4.2 (and up), it uses ~139MB

image (on this picture, main uses ~4.1.6, nestjs-8 uses ~4.3.0)

to reproduce, just swap between versions 4.1 and 4.3

Darkein commented 2 years ago

after some investigations, it looks like it comes from the latest version of swagger-ui-dist latest version image

before image image