There is no memory leak problem with Java storage

Source: Internet
Author: User

There is no memory leak in the Java store. We first need to understand what a memory leak is. Memory leaks in Java in short, the object is used up, and the memory space occupied by the object is not released until the program finishes running .

So now it's the problem! Don't we say Java has a good garbage collection mechanism? Why is there still a memory leak? At this point we need to understand the mechanism of the GC. when the program is running, the heap memory space object is not referenced, the heap memory space belongs to the garbage space , should wait for GC recycle, this is no problem. But then! There is also the case that when the heap memory space is referenced by other objects (as an object of a) , even if the object of the heap memory space is released by itself, if the A object does not release a reference to it, the GC cannot be reclaimed, so there is a memory leak. Similar

If it is not correct, look at it. Thank you

There is no memory leak problem with Java storage

Related Article

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.