Java Garbage Collection Preliminary understanding

Source: Internet
Author: User

Java technology provides a system-level thread, the garbage collector thread (low thread priority), the garbage collection thread execution in a Java program is automatic, cannot be enforced, you can call JAVA.LANG.SYSTEM.GC () manually, notify the JVM GC (garbage Collection), after the JVM accepts this message, it does not immediately do garbage collection, but only a few garbage collection algorithms are weighted, so that garbage collection operations are prone to occur, or early.

GC is performed when Java memory is low, and GC is performed when the virtual machine is idle.

Once the GC is ready to release the storage space occupied by the object, it first calls the Finalize () method to perform some necessary cleanup work. The memory space occupied by this object is only really released until the next garbage collection action.

Finalize () is used for objects, but before the object memory is freed, but the Finalize method of the object class performs a non-specific operation; It performs only a few general returns. Subclasses of Object can override this definition.


  

  

Java Garbage Collection Preliminary understanding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.