• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Garbage collection

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)what are rhe correct options.
1. You can directly free the memory allocated by an object.
2. You can directly run the garbage collector whenever you want to.
3. The garbage collector informs your object when it is about to be garbage collected.
4. The garbage collector reclaims an object�s memory as soon as it becomes a candidate for garbage collection.
5.The garbage collector runs in low-memory situations
please explain answers
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi George,
I'm going to move this post to the Certification forum as it's not related to results

------------------

Jane Griscti
Sun Certified Java 2 Programmer
"When ideas fail, words come in very handy" -- Goethe
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello George,
Only 3 is the correct answer.

The automatic garbage collector calls the finalize method in an object which is eligible for garbage collection before actually destroying the object.
------------------
Regards,
Raj.
-------------------------
Afforts should be Appriciated.
-------------------------
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!
By garbage collection you can directly free the memeory allocated.But, you can never force a garbage collection because you never know when thje object will be garbage collected or ever it will be garbage collected.Garbage collection runs in low memory situations in order to free the allocated memory space and store them in a heap for reuse.Garbage collection thread is a low priority thread.So, you can never tell when the thread will run.Because the high priority thread would interrupt its execution.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer is 2,3, 5
2. gc can be run anytime ( even thoug its not efficient ) by Runtime rt = Runtime.getRuntime(); rt.gc();
3 and 5 are already explained in the previous responses.
Thank you
Sudhakar

[This message has been edited by Sudhakar Reddy (edited January 19, 2001).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic