> On Sunday 17 August 2003 21:41, Max Rydahl Andersen wrote:
> > how about just calling clear() on the session after each "cache less"
> > work you need ?
> >
> 
> Uhm... what is the overhead of inserting the objects in the cache to
> remove them afterwards if you're inserting 200.000 bjects in
> the database? Using direct SQL provided a 40% performance increase
> compared to the version that was using the cache and the memory
> used was around 60MB instead of 170MB (which also means that 
> the second version would trash badly anything with less than 256 MB,
> and remember this is a client application). I guess that calling clear() would
> limit the memory used, but would also generate more garbage? (I mean, the
> cache also contains a serialized version of the object or something similar to
> catch what changed since the session begin, ins't it?)

What if YOU just reused the same object instance for your 200.000 objects between
each clear() call ? Then Hibernate should only do a few things that probably in your 
usecase scenario could be classifed as "garbage", but in all other aspects are Good 
Things ;)

And also remember to fiddle with your -mx and -gc jvm settings to
tune your VM to be better at handling such memory bursts! It can make quite a big 
difference - without changing a single line of code!

Best regards,
Max


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to