fix: Memory leak on global IOC container and classValidatorMetadataStorage
#2540
Labels
status: needs triage
Issues which needs to be reproduced to be verified report.
type: fix
Issues describing a broken feature.
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 userContainerThe text was updated successfully, but these errors were encountered: