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 with database context #394

Open
thegolddustrush opened this issue Sep 30, 2022 · 2 comments
Open

Memory leak with database context #394

thegolddustrush opened this issue Sep 30, 2022 · 2 comments

Comments

@thegolddustrush
Copy link

Not sure if this project is still alive. I have been struggling with memory leaks with this latest version of ninject and Mvc final release (v5). My entity framework context is instantiating over and over again without being disposed. I have put a static class counter for my db context and it runs thousands I can see eventually under heavy user activity it gets sluggish and needs an IIS worker thread recycle. I am using default transient scope. I tried request scope and seems to properly dispose the context as I see the class counter for my db context stays stable but I get services injected with ninject being disposed prematurely when I test with multiple users but it seems to work ok with one user. I use ninject for constructor injection for controllers and services injected into controllers use constructor injection too so I'm expecting it to handle the injection recursively.

Is there any known fixes for these memory leak issues?

Any help is appreciated.

@scott-xu
Copy link
Member

scott-xu commented Mar 5, 2023

Can you please elaborate "but I get services injected with ninject being disposed prematurely when I test with multiple users" with more details?

@thegolddustrush
Copy link
Author

Basically that means I get error where the object is being used or referenced when it is already disposed.

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

No branches or pull requests

2 participants