Skip to content

Multiple Image Uploads result in memory leak #6432

@iserko

Description

@iserko

Describe the bug
Memory leak due to image uploading both with and without responsiveDimensions and sizeOptimization disabled via Media Library settings.

If you upload multiple images at the same, the memory consumption increases according to the number of images you're uploading.

Tested with:

  • strapi-provider-upload-local 3.0.1
  • strapi-provider-upload-aws-s3 3.0.0

Steps to reproduce the behavior
I run Strapi inside Docker, so I monitor memory usage by running docker stats

Have made a video:

  1. Start a fresh Strapi server ... memory usage 93 MB
  2. turn off Image optimization and Responsive Dimensions via /admin/settings/media-library 3. go to the Media Library and upload an image 490 kB in size ... memory usage now 122 MB
  3. upload another image 149 kB in size ... memory usage now 135 MB
  4. enable Image optimization and Responsive Dimension via /admin/settings/media-library
  5. upload another image 325 kB in size ... memory usage now 257 MB

Expected behavior
I would expect the additional memory usage to be much lower and stable.

Screenshots
Video: https://drive.google.com/file/d/1wNVkRLKagVQuRp8Vuld6FADrilfmS00n/view?usp=sharing

System

  • Node.js version: 12.16.3
  • NPM version: 6.14.4
  • Strapi version: 3.0.1
  • Database: PostgreSQL
  • Operating system: Debian Buster running inside Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:uploadSource is core/upload packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more information

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions