aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mark and Sweep Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mark and Sweep" Watch "Mark and Sweep" New topic
Author

Mark and Sweep

Dinesh Tahiliani
Ranch Hand

Joined: Aug 06, 2007
Posts: 486
On what concept garbage collector works ?
What is the concept of memory sweep?




please ranchers explain this concept in brief


Thanks in advance


Thanks<br />Dinesh
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

It is not specified how GC works. You can not be sure about that. You can read somewhere that it uses for example mark&sweep algorithm but it is not obligatory.


SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
Nitish Bangera
Ranch Hand

Joined: Jul 15, 2009
Posts: 537

Well from java5.0, automatic garbage collection has taken effect so the garbage collection is under the control of the JVM. Well i guess the memory sweeping concept is out of question now.


[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

So what was before Java 5?
Nitish Bangera
Ranch Hand

Joined: Jul 15, 2009
Posts: 537

Before that java5, garbage collection could be done manually i suppose but it wasn't automatic. Well some info on the history of garbage collection could be found here .
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

Thanks for interesting link.
Dinesh Tahiliani
Ranch Hand

Joined: Aug 06, 2007
Posts: 486
In simple what does mark does and sweep does?
Please answer .
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13884
    
  10

Nitish Bangera wrote:Before that java5, garbage collection could be done manually i suppose but it wasn't automatic.

Garbage collection has always been automatic in Java, it has never been the case that you had to call the garbage collector explicitly to do garbage collection, not even in Java 1.0.

It's interesting to know how garbage collection (note the link) works, but you do not need to know such internal implementation details of the JVM for the SCJP exam.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Mark and Sweep
 
Similar Threads
passed SCJP 1.4 with 96%
GC and Timer
Stack and Heap
Programming for clusters
what is a isolation level,is it a concept in EJB or a RDBMS concept?