Skip to content

fix: Memory leak on global IOC container and classValidatorMetadataStorage #2540

@lmeysel

Description

@lmeysel

Description

When using class-validator it is considered to act in a kind of "singleton" environment, sharing all the metadata once loaded. However e.g. when running integration tests (in my case for nest.js), this leads to memory leaks, as everything is loaded over and over again for each test suite. In #1236 it is declared as by design. However it would be nice to have some kind of cleanup method which resets all the global storages, and cleaning the instance array of the defaultContainer, as well as unsetting the userContainer

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageIssues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions