Article Summary: About finalize, reference, and reference queues for Java, automatically releasing some articles from external resources of the system

Source: Internet
Author: User
Tags java reference

Previously wrote a blog about how non-heap memory is automatically released, and thus slowly extended to write about garbage collection, finalize mechanism, reference and reference queue, Sun.misc.Cleaner related articles, through these articles feel very big harvest, Java garbage Collection related knowledge more profound. This blog mainly to do a summary and introduction, according to their own ideas of the extension, the blog summary, convenient for everyone to read and view.


1, when learning NiO, for the automatic release of Directbytebuffer heap outside memory, so the first blog

Use of out-of-heap memory in Java, things to remember about memory recycling and unresolved legacy issues (such as the Big God solution)

http://blog.csdn.net/aitangyong/article/details/39323125


2. In order to study how NiO realizes the automatic release of out-of-heap memory, a second blog is generated

System.GC () and-XX:+DISABLEEXPLICITGC startup parameters, and Directbytebuffer memory release

http://blog.csdn.net/aitangyong/article/details/39403031


3. After studying the automatic release mechanism of NIO, it leads to finalize and Sun.misc.Cleaner, with the third article

Effective Java item7:avoid finalizers, explains why finalize is unsafe and does not recommend using

http://blog.csdn.net/aitangyong/article/details/39450341


4, in order to solve the lack of finalize, learned the following Java Reference and reference queue mechanism, with the fourth article

4 reference differences and usage scenarios in Java (including theory, code, and execution results)

http://blog.csdn.net/aitangyong/article/details/39453365


5, finally using the previous learning theory, wrote a self-release heap memory code, with the fifth article

Automatic release of Out-of-heap memory using Sun.misc.Cleaner or phantomreference

http://blog.csdn.net/aitangyong/article/details/39455229


6, the recent simple to do a summary

Some conclusions about the finalize mechanism and reference and reference queue

http://blog.csdn.net/aitangyong/article/details/39478261



Article Summary: Finalize, reference, and reference queues for Java, automatically releasing some articles from external resources of the system

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.