Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

bill brogden exam question...

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the following line is marked as true in #16(exam cram)-
The method by which Java determines that a chunk of memory is garbage is up to the implementer of the JVM.
I have problems understanding this... the mode of gc is dependant upon the JVM, not determining what is garbage. If there are no references to it, or the references are from an object that itself has no reference( or a circular reference from the former object), that chunk is junk!
Thanks to the ambiguities of Englishlanguage, maybe you can somehow contrive another meaning of this, but to me, this is what it means.
any comments appreciated, esp. those of Bill.
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who coins the rule: "If there are no references to it, or the references are from an object that itself has no reference( or a circular reference from the former object), that chunk is junk" ?
the implementer of JVM, i guess
 
Anshuman Acharya
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think i see your point a bit...(and thanks for repeating it )... but who is this mysterious implementer of JVM?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am just trying to say the the Java Language Spec does not lay down the law on the exact algorithm to be used to determine that a chunk of memory has no references. Designing the GC mechanism for a particular JVM is left up to the implementor. There is a huge body of Computer Science on GC mechanisms, but you don't have to worry about that.
In other words - the criterion for a collectable object is defined but the mechanism for discovering that the criterion is met is up to the implementor.
Bill

------------------
author of:
 
Anshuman Acharya
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, i get the difference.
the difference is betwwen the methods used to "decide" what is garbage and to "determine" where is the garbage, right?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My God!!
Are we talking about the JVM manufacturer? Like, sun JVM and Microsoft JVM (anything else?) may use different criterias to decide whether the chunk of memory is elligible for GC?
Ananda.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Specification says that unreachable objects are eligible for garbage collection.
The algorithm which a particular JVM uses to determine that an object is unreachable is up to the designer of the JVM. Creating the algorithm suitable for particular applications - ie browser versus server versus cell phone - is an arcane science.
For the exam, you don't have to know anything about the GC algorithm, just what qualifies an object for GC.
Bill
reply
    Bookmark Topic Watch Topic
  • New Topic