• 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: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Is the following statement true or false?

Garbage collection mechanism is platform independent.

Please clarify.
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Truth About Garbage Collection
Reference Objects and Garbage Collection
Garbage collection and performance
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The link is good and is discussing about how Garbage collector marks the objects that are not reachable.

But I am not able to find whether Garbage collection is platform dependent or not?
 
Steve Morrow
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The link is good and is discussing about how Garbage collector marks the objects that are not reachable.

But I am not able to find whether Garbage collection is platform dependent or not?


From the first link, paragraph A.1: the JVM is responsible for freeing unused memory.

So, depending on what you intend by your question, GC both is and is not platform dependent. JVMs are unique to particular platforms (i.e., a Mac JVM is for Mac, *nix for *nix, etc.), however the whole concept of a VM for Java supports platform independence.

Hope this helps.
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess Java as a whole is Platform-Independent. It achieves this independency through JVMs which as steve said, are "platform-dependent".
There is separate JVM for linux, which converts byte codes as per linux platform, there is separate JVM for windows which converts byte codes as per windows environment, etc.

IMO,

Garbage collection is JVM dependent which in turn is platform dependent.



Correct me if I am wrong...
[ September 28, 2005: Message edited by: Akhil Trivedi ]
 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You can think in this way...

Execution of Threads are dependent on the platform that they are running on....And Gc is also a thread ....so we can sum up....that Gc is indeed dependent on the platform that it is running on....

Correct Me if am wrong!!!

Regards
 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kumar

Execution of Threads are dependent on the platform that they are running on....And Gc is also a thread ....so we can sum up....that Gc is indeed dependent on the platform that it is running on....


I feel you are wrong .. How you are relating, excecution of Thread with GC.

main() method is also executed by a Thread, So do you say it's platform dependent.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,


Thanks for pointing it out....

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic