WebJob memory leak

Skip to first unread message


May 1, 2019, 11:11:19 AM5/1/19
to ninject
Hi guys,

We're using Ninject for both Web project and Azure WebJob for background worker. Not so long ago I realized that WebJob crashes with out of memory exception every once in a while.
Datacontext is bound into WebJob in Thread Scope:
.ToMethod(context => new EntitiesContext())

So I tried using NamedScope extension with InCallScope - no luck.

It might be helpful to say that when I wrap datacontext inside using memory is being released:
using(var db = new dataContext) {
var temp = db.Users;

But when I do the same with Repository memory stays on the same level.

I would appreciate any ideas.
Reply all
Reply to author
0 new messages