In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what the jvm advanced interview questions are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
2.7.1. Serial garbage collector (single thread, replication algorithm)
Serial (continuous English) is the most basic garbage collector, using the replication algorithm, it was once the only garbage collector of the new generation before JDK1.3.1. Serial is a single-threaded collector that not only uses one CPU or one thread to complete garbage collection, but also must pause all other worker threads until garbage collection is complete.
Although the Serial garbage collector needs to pause all other worker threads during garbage collection, it is simple and efficient. For defining a single CPU environment, it has no thread interaction overhead and can achieve the highest single-thread garbage collection efficiency, so Serial
The garbage collector is still the default new generation garbage collector for the java virtual machine running in Client mode.
2.7.2. ParNew garbage Collector (Serial+ multithreading)
The ParNew garbage collector is actually a multithreaded version of the Serial collector and also uses replication algorithms. Except for using multithreading for garbage collection, the behavior of the ParNew garbage collector is exactly the same as that of the Serial collector. The ParNew garbage collector also pauses all other worker threads during the garbage collection process.
The ParNew collector has the same number of threads as CPU by default, and the number of threads in the garbage collector can be limited by the-XX:ParallelGCThreads parameter. [Parallel: parallel]
ParNew is almost identical to the Serial collector except for multithreading, but the ParNew garbage collector is the new generation of default garbage collector for many java virtual machines running in Server mode.
2.7.3. Parallel Scavenge collector (multithreaded replication algorithm, efficient)
Parallel Scavenge collector is also a new generation garbage collector, which also uses replication algorithm and is also a multi-threaded garbage collector. It focuses on achieving a controllable throughput (time spent by Thoughput,CPU running user code / total time consumed by CPU, that is, throughput = time to run user code / (time to run user code + garbage collection time))
High throughput can make the most efficient use of CPU time to complete the operation tasks of the program as soon as possible, which is mainly suitable for tasks that operate in the background without too much interaction. Adaptive adjustment strategy is also an important difference between ParallelScavenge collector and ParNew collector.
2.7.4. Serial Old collector (single-threaded tag finishing algorithm)
Serial Old is an older version of the Serial garbage collector. It is also a single-threaded collector that uses the tag-collation algorithm.
This collector is also mainly run on Client's default java virtual machine, the default older garbage collector.
In Server mode, there are two main uses:
1. Used with a new generation of Parallel Scavenge collectors in previous versions of JDK1.5.
two。 As a backup garbage collection solution for the older generation using the CMS collector.
Garbage collection process diagram of the new generation Serial and the older generation Serial Old:
The working principle of the new generation of Parallel Scavenge collectors is similar to that of ParNew collectors, both are multithreaded collectors, use replication algorithms, and need to pause all worker threads during garbage collection. Garbage collection process diagram of the new generation ParallelScavenge/ParNew and the older generation Serial Old:
2.7.5. Parallel Old collector (multithreaded tag finishing algorithm)
The Parallel Old collector is an older version of Parallel Scavenge, which uses a multi-threaded mark-and-collate algorithm and is only available in JDK1.6.
Before JDK1.6, the new generation of ParallelScavenge collectors can only be used with the old generation of Serial Old collectors, which can only guarantee the throughput priority of the new generation, but not the overall throughput. Parallel Old is precisely to provide the same priority garbage collectors for throughput in the old generation. If the system requires high throughput, priority can be given to the collocation strategy of the new generation ParallelScavenge and the old generation Parallel Old collectors. The running process chart of the new generation Parallel Scavenge and the old generation Parallel Old collector:
The above is all the contents of the article "what are the jvm Advanced interview questions?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.