JVM Garbage Collection

Source: Internet
Author: User

Reference counting method

Mark Clear Method

Copy method (new generation, suitable for many garbage objects, fewer surviving objects)

Tag compression method (old age) equivalent to the tag cleanup algorithm + memory defragmentation

Strong references,

Soft references (SoftReference), which are reclaimed when heap space is low, and soft references do not cause memory overflow

Weak references (weakreference), found to be recycled

Virtual reference

Garbage collector:

Serial collector:-XX:+USESERIALGC

Disable System.GC ()

Maximum age for Cenozoic objects:-xx:maxtenuringthreshold=15 default is 15, which means up to 15 recoveries into the old age.

The default value of--XX:TARGETSURVIVORRATIO=50 is 50, which indicates that the survivor zone has more than 50% usage after GC, and may use a smaller age as a promotion, rather than maxtenuringthreshold=15

Tlab Enabled:-xx:+usetlab

Direct Memory Request: bytebuffer.allocatedirect (int)

Parameter settings:-xx:maxdirectmemorysize

Method Area (permanent area):-xx:maxpermsize=5m

JVM Garbage Collection

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.