• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dan's new Garbage Collection Exam

 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just uploaded a new beta version of a garbage collection exam.
Today, there are only six questions in this early version of the gc exam, but I'll be adding more soon.
These questions are difficult but I hope that the remarks that are included with the answers will provide a good explanation of the concepts.
Some of the questions include the use of wait and notify so an understanding of threads is required for those questions.
 
Ranch Hand
Posts: 513
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally you put the gc questions. I felt that the gc questions looked a bit long.
However thank you for your endeavors!!
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the garbage collection questions are a little long. It is difficult to come up with a garbage collection question in the form of a complete program without making the question long. That's why most of the questions on the real exam are not complete programs.
The purpose of the real exam is to test your knowledge of the material. The purpose of my exam is to provide a useful study tool that will contribute to your understand of the material as you work through a study guide chapter-by-chapter. For that reason, my questions will be a little different from those that appear on the real exam.
It will take a little longer to work through my questions. Don't worry about the time. Just enjoy the experience.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don,
In your g.c. questions 4-6 one of the options is :
a. An unreachable object can never become reachable again.
You are stating in the answers:
Objects that are unreachable can become reachable again if the finalize method assigns a reference to its instance to a member of another object that is reachable.
Here is an excerpt from the article on the subject (http://www.artima.com/insidejvm/ed2/gcP.html)
It says: "An object is in the RESURRECTABLE state if it is not currently reachable by tracing the graph of references starting with the root nodes, but could potentially be made reachable again later when the garbage collector executes some finalizer. All objects, not just objects that declare a finalize() method, pass through the resurrectable state. As mentioned in the previous section, the finalizer for an object may "resurrect" itself or any other resurrectable object by making the objects reachable again. Because any object in the resurrectable state could potentially be made reachable again by its own or some other object's finalize() method, the garbage collector cannot reclaim the memory occupied by a resurrectable object before it makes certain the object won't be brought back to life through the execution of a finalizer. By running the finalizers of all resurrectable objects that declare a finalize() method, the garbage collector will transform the state of all resurrectable objects, either back to the reachable state (for objects that get resurrected), or forward to the unreachable state.
The UNREACHABLE state indicates not only that an object is no longer reachable, but also that the object cannot be made reachable again through the execution of some finalizer. Unreachable objects can no longer have any affect on the running program. The garbage collector, therefore, is free to reclaim the memory they occupy."
Am I missing something?
Anna.
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anna,
Thank you for the quote from the Artima gc tutorial. I hadn't previously read it so I was not familiar with their new term, RESURRECTABLE, which they appear to be using in place of the term used in Section 12.6.1 of the Java Language Specification, finalizer-reachable. Now that you have pointed it out, I think I like the Artima version.
I assume that a lot of people will be reading the Artima gc tutorial so I suppose I should change my exam to include both the JLS term and the possibly more familiar Artima term. Previously, I though that the term "unreachable" would be more clear.
Thank you for pointing that out.
[ October 19, 2002: Message edited by: Dan Chisholm ]
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anna,
I just uploaded a new version. The answer option is now as follows.


a. A finalizer-reachable or finalizable (also known as resurrectable) object can never become reachable again.


The remark associated with the answer is now as follows.


Objects that are finalizer-reachable or finalizable can become reachable again if the finalize method assigns a reference to its instance to a member of another object that is reachable. Please see section 12.6.1 of the Java Language Specification for more information.


How do you feel about the new version?
 
Anna Swartz
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks good to me! The real question is, which language they are going to use at the exam?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic