-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Many transient objects - session and cache
PostPosted: Fri Feb 16, 2007 7:09 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi,

My application allows the user to perform a lot of what-if analysis that creates many transient child objects under a parent object. These are not saved to the DB until explicitly requested by the user (the collection of child objects is cleared before the parent is saved) and this may be after many web requests to tweak the settings on the parent object.

The child objects are not saved to the DB purely for performance reasons as I have found that it is far quicker to regenerate them in memory than to read and update the hundreds of objects in the DB every request. However, there is a point where the user has the option to lock in the settings and save a fixed set of results and they are then persisted to the DB.

I am seeing the memory usage of my aspnet_wp increase with each page request which seems to indicate that something might not be right.

I have configured a 2nd level cache for all of the objects in my domain, most with read-write.

A few questions:

1. Do transient objects only get cached in the session when they are persisted to the DB?

2. What about the 2nd level cache...I assume they only get added to this when persisted to the DB as well?

3. Am I able to find out what is gobbling up the memory in the aspnet_wp and how can I minimise this?

Any pointers greatly appreciated.

Thanks,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 12:58 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Basically entities will only end up in the first level cache when you load a persistent object or when you call on of the save or update methods. If you're dealing with truly transient objects (ie, not persistent, not detatched) then they shouldn't appear in any cache.

When I've had memory problems in the past I've used a .NET profiler. Have a look at this blog entry for a few links: http://davidhayden.com/blog/dave/archiv ... /2632.aspx

(It's been a while since I found it, so I don't know if all the links are still good)

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 16, 2007 4:25 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Thanks Symon...I'll check out some of the profilers that I found via your link.

I believe that my objects truly are transient because they do not get persisted to the database (I am sure of that from looking at SQL profiler).

Are there any considerations that I should be aware of for cleaning up these transient objects so that they don't consume memory (I am merely clearing the child collection before I save the parent)?

Cheers,

Jason


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.