WebJob memory leak

30 views
Skip to first unread message

simv...@gmail.com

unread,
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:
Bind<EntitiesContext>()
   
.ToMethod(context => new EntitiesContext())
   
.InThreadScope();

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
Forward
0 new messages