Jvm cms collector, jvmcms collection

Source: Internet
Author: User

Jvm cms collector, jvmcms collection

CMS (Concurrent Mark Sweep) has the shortest pause recovery and is suitable for maintaining the response time requirements.

  • Initial tag Initial mark: mark the objects that can be associated with GC Roots. Stop-mark.
  • Mark Concurrent mark: GC Roots tracing for Concurrent business threads.
  • Remark: remark the tag record of the object that changes when the user program is running at the same time. Stop-mark.
  • Concurrent cleanup Concurrent sweep: Clear useless objects.

The initial tag and re-tag take a short time.

Disadvantages:

  • In the concurrency phase, cpu resources are used, user programs are slowed down, and throughput is reduced. CMS is enabled by default (CPU + 3)/4 threads for execution.
  • Floating Gorbage cannot be processed. The garbage generated by the user program in the concurrent cleaning stage becomes Floating garbage and cannot be processed for the same time. In order to reserve the user program to use memory, the CMS needs to collect data at a certain percentage in the old age.-XX: CMSInitiatingOccupancyFractionSet the ratio of CMS in the old age.
  • The CMS Based on the tag clearing algorithm will produce a lot of space fragments in the old age, which is not conducive to the use of large objects.-UseCMSCompactAtFullCollection (true by default)To fragment and compress when CMS is to be collected. This setting will cause a pause. You can also set-XX: CMSFullGCsBeforeCompactionTo set the number of times the CMS is executed, that is, the number of times the CMS is collected, the number of times the fragment is executed.

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.