-->
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: Local variables not garbage-collected
PostPosted: Mon Sep 27, 2010 2:54 am 
Newbie

Joined: Mon Sep 27, 2010 2:07 am
Posts: 3
I have the following...

Code:
public class A
{
   private Set items;
}

private void foo()
{
   A a = (A) session.get(A.class, ...);
}


After foo runs, "a" is not garbage-collected. There is an equal instance but referenced elsewhere in a collection that exists as long as the application is running.

So, if I run foo 5 times, I have 6 instances of A (one which is not supposed to be GCed), even after forcing GC (through a profiler).

Only when I remove the instance of A in the collection, then will all 6 instances by GCed.

Am I not using Hibernate correctly?


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.