It is currently Sat Nov 26, 2011 8:21 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: GC Calls
PostPosted: Mon Oct 19, 2009 1:59 am 
Offline
Developer

Joined: Thu Oct 08, 2009 1:18 am
Posts: 62
Hello Devs,

Question about the explicit calls to the garbage collector. I've noticed there are at least 3 calls to force garbage collection. Was benchmarking done to decide where these should be placed? Adding GC calls is usually not recommended, as Java can almost always pick a better time to do it.

There's also places where local variables are set to null before the end of a method. I don't understand the reason for these, as they will be cleared as soon as they go out of scope.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 19, 2009 8:35 am 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 4:11 pm
Posts: 645
Location: Netherlands
On the previous version of Mac OS (leopard), there were serious bugs in the memory management of ted. I noticed that items that were in a vector that went out of scope were not cleaned up, leading to memory usage of over 1 gb in an hour. Setting the vector to null somehow cleared the references to the contents and everything got cleaned up like it should.
It might already be solved by a mac java update, I'm not sure.

Calling the garbage collector explicitly might not be needed anymore, I think I introduced that code while trying to solve the memory problems on mac.

_________________
Roel

i watch: simpsons, south park, lost, top gear, true blood & fringe
download - documentation - bugs/feature requests - sourceforge -


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 19, 2009 2:10 pm 
Offline
Developer

Joined: Thu Oct 08, 2009 1:18 am
Posts: 62
Interesting bug, I hadn't heard of Java doing this before. Well, not unless there was cyclical references.

Maybe down the road I'll run it through YourKit or JProfiler and see if the memory issues still exist without the calls.

Thanks Roel,

Kenny


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group