Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Collection

 
disen tan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wonder if all the j2me-enabled phone will have the auto garbage-collection feature. That means the application manager will call the system.gc() for us when the memory usage is approaching the limit or it's is the case that we (programmer) have the call the system.gc() ourself....
 
Prasaath Pras
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The midp manager automatically calls the garbage collector but Not all phones support garbage collection.It is better that in the program to have garbage collector
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every Java phone *must* support automatic garbage collection. Plus, I do not think there is a way to manually force the GC to run. The system.gc() call merely *suggest* the system to run GC at a convenient time.
 
disen tan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx guys, really appreciate ur answers.. but one of the know issus in nokia 6600 midp2.0 implementation is that the garbage collection is extremely slow and will cuase a while of "hang".... anyone have the experience of it?
 
Orika Akawana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep... 1. all "phones support" (java supports) ) garbage collection.
2. you do not need to call GC by your self. But it is a "good way" to assign null to objects. Actually it is also not so necessery but your code will be more clear for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic