View unanswered posts | View active topics
|
Page 1 of 1
|
[ 3 posts ] |
|
Author |
Message |
KenMacD |
Post subject: GC Calls
Posted: Mon Oct 19, 2009 1:59 am
|
|
|
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 |
|
|
roel |
Post subject:
Posted: Mon Oct 19, 2009 8:35 am
|
|
|
Lead Developer |
|
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 |
|
|
KenMacD |
Post subject:
Posted: Mon Oct 19, 2009 2:10 pm
|
|
|
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 |
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
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
|