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.  [ 1 post ] 
Author Message
 Post subject: Open session in view + JSTL forEach = memory leak?
PostPosted: Fri Jul 02, 2004 12:19 pm 
Newbie

Joined: Wed Jan 07, 2004 5:30 pm
Posts: 11
Location: SF, CA
Hi folks. I have a Struts-based hibernate app which I've been working on for quite a while. Recently, as my objects grow larger and more complex, it's come to my attention that I've got a memory leak (our staging server was going down after a day of heavy use with OutOfMemory errors).

Using JProfiler, I had a look at the heap and realized that some of my more complex objects (having several child collections of complex objects) were 1 meg + (deep) each. This was generally fine in my view as they were pretty much always bound to the request, and the lazy collections were fleshed out using a servlet filter similar to the one shown here: http://www.hibernate.org/43.html

The problem is, *something* was not allowing those objects to be garbage collected. Oddly enough, all evidence so far points to the JSTL forEach tag. The tag seems to be steadfastly holding a reference to collection it iterated through even though the session has been closed and the request is completed. This is pretty worrying stuff.

I've replaced the offending "forEach" instance looping through my large objects with scriptlet code, and lo and behold, these objects GC just fine. Then I can change it back to using the JSTL tag and the objects stick. It's very reproducable, which is why i'm bothering to say anything about it here.

Now, as I'm generally pro-JSTL, I'm kind of irritated that this is happening. Has anyone else experienced this? Does anyone have any suggestions? Velocity? My own custom tag?

I just thought I'd put this out there in case anyone ran into the same thing...


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

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.