Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lmeysel opened this issue Oct 16, 2024 · 0 comments
Open
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.

Comments

@lmeysel
Copy link

lmeysel commented Oct 16, 2024

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

@lmeysel lmeysel added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.
Development

No branches or pull requests

1 participant