Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Stop-The-World

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

The so-called Stop the World mechanism, or STW for short, means that when the garbage collection algorithm is executed, all other threads of the Java application except the garbage collector thread are suspended.

At this point, the system can only allow the GC thread to run, and all the other threads will be paused and wait for the GC thread to finish execution before running again.

These tasks are initiated and completed automatically by the virtual machine in the background, which stops all the threads that the user is working normally when the user is invisible, which is unacceptable for many applications, especially those programs that require high real-time performance.

In addition to garbage collection, there are other actions that trigger STW.

CMS collector: (- XX:+UseConcMarkSweepGC): used to recycle the older generation.

Serial collection and parallel collection need to pause the entire running environment during garbage collection, so the system will have an obvious pause during garbage collection, and the pause time will be longer as the heap is larger.

The concurrent collector can ensure that most of the work is executed concurrently and the application is not paused. This garbage collector is suitable for minimizing the pause time of the application, reducing the probability of full gc occurrence, using the garbage collection thread concurrent with the application thread to mark the cleaning older generation, suitable for systems with priority response time (more commonly used, suitable for larger systems).

CMS does not have no pauses, but replaces the long pauses of the serial tag collation algorithm with two short pauses.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report