aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Garbage collection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Garbage collection" Watch "Garbage collection" New topic
Author

Garbage collection

Roja Rani
Greenhorn

Joined: Sep 28, 2005
Posts: 22
Hi All,

Is the following statement true or false?

Garbage collection mechanism is platform independent.

Please clarify.
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

The Truth About Garbage Collection
Reference Objects and Garbage Collection
Garbage collection and performance
Swathi Sree
Greenhorn

Joined: Aug 27, 2005
Posts: 19
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

Joined: May 22, 2003
Posts: 657

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.
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1493
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 ]

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 973
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
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
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.


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 973
HI,


Thanks for pointing it out....

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Garbage collection
 
Similar Threads
gc ??
Tech Word Game
Return values of methods
i passed with 81%
what is the difference between local garbage collection and remote garbage collection