• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class unloading

 
Nick Bransby-Williams
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As I understand the classes of a midlet suite are loaded by the kvm dynamically when needed, not all in one go at startup.
Are they ever unloaded before the application exits? Does this free up heap space? Is the garbage collector responsible for freeing up memory taken up by classes?
Thanks
Nick
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to manually dispose network connections, RMS stores and RMS enumerators etc -- just as what you do in J2SE. Everything else is taken care of by the GC. You can reduce the GC usage by reusing existing objects (Forms and StringBuffers) as much as possible.
 
Nick Bransby-Williams
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about the inter workings of the vm. At what point is a class's bytecodes loaded into memory from persistent storage (the first time the class loader find a reference to it from another class?) and when is it unloaded? And is the memory required for the bytecodes allocated from the heap shared with object data?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic