New Posts New Posts RSS Feed: Clearing Entity/Query Cache (memory leak)
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Clearing Entity/Query Cache (memory leak)

 Post Reply Post Reply
Author
tooms View Drop Down
Newbie
Newbie
Avatar

Joined: 17-May-2011
Location: Brisbane
Posts: 4
Post Options Post Options   Quote tooms Quote  Post ReplyReply Direct Link To This Post Topic: Clearing Entity/Query Cache (memory leak)
    Posted: 17-May-2011 at 3:21pm
I'm investigating memory leaks within our application and set up a small test app to narrow them down.
 
When I grab data using the PeristenceManager I can see the increase in memory use equivelant to the amount of data retrived. However when I clear those entities from the cache, the memory does not decrease. If the entities are grabbed again, the memory is increased by the same amount. If I continue this loop I can blowout memory use to the point where the application fails.
 
I have two questions.
 
I clear the cache using QueryCache.Clear() and DataSet.Clear()  ... Is this the correct way to do so?
 
and if this is the correct way, then it appears there is a memory leak within Ideablade. If a query increased memory use by 50mb (example only) and I then clear that cache, that 50mb is not released. Grabbing that data again increases memory use by another 50mb (100mb in total).
 
Cheers,
Paul Twomey
MEX
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 18-May-2011 at 12:03pm
Paul,
 
Do you still see this symptom if you use RemoveEntities instead? Also, what version of DevForce 2009 are you using, and is there any chance you could upload your test solution for me to take a look at? I'll certainly test this to see if there's a problem, but it might just be that the cleanup hasn't occurred yet. I don't know when garbage collection occurs for Clear and will ask.
 
-- Robert


Edited by robertg - 18-May-2011 at 12:23pm
Back to Top
tooms View Drop Down
Newbie
Newbie
Avatar

Joined: 17-May-2011
Location: Brisbane
Posts: 4
Post Options Post Options   Quote tooms Quote  Post ReplyReply Direct Link To This Post Posted: 18-May-2011 at 3:26pm
Using version 3.7.1.0
 
Ah indeed RemoveEntities does indeed work, that's good news.
 
I also started cleaing my grid controls data/binding source and that seems to make the .Clear() calls work, but they take longer to cleanup than RemoveEntities.
 
I'm not yet convinced, I still have definite memory leaks ... But there may be other culprits.
 
Cheers,
Paul Twomey
MEX
Back to Top
robertg View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 15-Mar-2011
Location: California
Posts: 87
Post Options Post Options   Quote robertg Quote  Post ReplyReply Direct Link To This Post Posted: 18-May-2011 at 3:36pm

Good to know, Paul. Let me know if you run into any other oddities, and we'll see what we can find.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down