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

Memory leak when definition unshared true #32

Closed
renaldyresa opened this issue Nov 9, 2022 · 7 comments · Fixed by #34
Closed

Memory leak when definition unshared true #32

renaldyresa opened this issue Nov 9, 2022 · 7 comments · Fixed by #34

Comments

@renaldyresa
Copy link

I has issue when make looping and get object with unshared set true. memory not release after function finish. Maybe because when get object, that object save in ctn.

@sarulabs
Copy link
Owner

sarulabs commented Nov 9, 2022

Hello,
unshared objects are still stored in the container. This was done because they may need to be closed when the container is deleted.
You can try the branch https://github.com/sarulabs/di/tree/speed_improvements
This is a complete rewrite of the project to improve performance.
On this branch only unshared objects with a close function are stored in the container.
This should resolve your issue.
If this work I will considerer merging this branch on master. I wanted to document the new features before doing so. But it has been more than a year now and I could not find the motivation.

@renaldyresa
Copy link
Author

Thank you, I think this can resolve my issue.

I think this is very great library, if this compare with another DI library in Go because is very easy to use and very simple.
Maybe this can give you motivation wkwk

@gaby
Copy link

gaby commented Jul 9, 2024

@sarulabs Do you plan to merge/release the speed_improvements branch?

Any plans to continue maintaince of this library?

@sarulabs
Copy link
Owner

sarulabs commented Jul 9, 2024

It's been two years already... I've really been lazy...
I'll merge the branch this weekend. Even if the documentation is not perfect.

Appart from that, I don't plan to work on new features. But I will always try to fix bugs.

@gaby
Copy link

gaby commented Jul 10, 2024

@sarulabs Thanks! I can help you with the GitHub Actions, to cover tests, lint, etc.

@sarulabs
Copy link
Owner

The branch speed_improvements_wip that was more or less speed_improvements with improved documentation was merged into master. The version v2.5.0 was released.

@gaby
Copy link

gaby commented Jul 14, 2024

@sarulabs Thank you, amazing work! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants