www.evidhyashala.com provides free free mock test , free online exam , online exam free test series , online exam free , Online Test Exam Series , free exam papers past papers , online exam form ,Online Test Series for Exam Prep. Free Mock Tests - for All govt jobs. Bank PO, Clerk, SSC CGL, CHSL, JE, GATE, Insurance, Railways, IBPS RRB, SBI, RBI, IPPB, BSNL TTA

Sponser Link

know more info pls click here

More on gc() method

More on gc() method

Unwanted (not used in the remaining part of the program) objects generated in the process are known as garbage. Java includes a special built-in style of removing the garbage known as garbage collection. Garbage collector is a low-priority service thread that removes the garbage periodically. It is a two step style and the algorithm is known as Mark and Sweep. First, the collector marks those objects that are not referenced anywhere in the program. In the second step, it removes those marked objects. The speed of removal varies depending upon the size of the heap and the microprocessor speed etc.


 
The programmer cannot force the JVM to go for garbage collection. It is an in-built phenomenon and is done at the discretion of the JVM. Programmer can maximum ask the JVM to go for garbage collection with the following statement, which need not be honored.

System.gc( );

System.exit(0)

exit(0) is a static method of System class which terminates a normal execution of a program. This style is used in AWT GUI to close the window. The zero parameter indicates a normal shutdown. Other than zero indicates abnormal shutdown.

0 comments:

Popular Posts