• Latest
  • Trending
  • All
  • Business News
  • Startup Investments
  • Startup News
  • Programming
  • Software Architecture
  • Web Security
JVM C1, C2 Compiler Thread: Excessive CPU Consumption?

JVM C1, C2 Compiler Thread: Excessive CPU Consumption?

8 months ago
8 Knowledge Constructions That Energy Your Databases

8 Knowledge Constructions That Energy Your Databases

4 days ago
Let’s Architect! Architecting for governance and administration

Let’s Architect! Designing event-driven architectures

7 days ago
EP 42: Designing a chat utility

EP 42: Designing a chat utility

2 weeks ago
Textual content analytics on AWS: implementing an information lake structure with OpenSearch

Textual content analytics on AWS: implementing an information lake structure with OpenSearch

2 weeks ago
EP 41: What’s Kubernetes?

EP 41: What’s Kubernetes?

3 weeks ago
Streaming the AWS Wickr desktop consumer with Amazon AppStream 2.0

Streaming the AWS Wickr desktop consumer with Amazon AppStream 2.0

3 weeks ago
EP 40: Git workflow – by Alex Xu

EP 40: Git workflow – by Alex Xu

4 weeks ago
Genomics workflows, Half 4: processing archival information

Genomics workflows, Half 4: processing archival information

4 weeks ago
EP 39: Accounting 101 in Fee Techniques

EP 39: Accounting 101 in Fee Techniques

1 month ago
Prime 10 AWS Structure Weblog posts of 2022

Prime 10 AWS Structure Weblog posts of 2022

1 month ago
Deploying Oracle RAC in AWS Outposts by way of FlashGrid Cluster

Deploying Oracle RAC in AWS Outposts by way of FlashGrid Cluster

1 month ago
EP 38: The place will we cache information?

EP 38: The place will we cache information?

1 month ago
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions
Thursday, February 2, 2023
  • Login
Startup News
  • Home
  • Startups
    • All
    • Business News
    • Startup Investments
    • Startup News
    Market analysis startup Bolt Perception receives funding from 212 — Retail Know-how Innovation Hub

    Market analysis startup Bolt Perception receives funding from 212 — Retail Know-how Innovation Hub

    [Funding alert] Fintech startup FinBox raises $15M in Sequence A spherical led by A91 Companions

    [Funding alert] Fintech startup FinBox raises $15M in Sequence A spherical led by A91 Companions

    NRMA backs VC’s $50 million agritech fund

    NRMA backs VC’s $50 million agritech fund

    Fanclash funding: Esports fantasy startup FanClash raises $40 million Collection B spherical

    Fanclash funding: Esports fantasy startup FanClash raises $40 million Collection B spherical

    Turkish enterprise capital fund ‘hunts’ for seed-stage startups

    Turkish enterprise capital fund ‘hunts’ for seed-stage startups

    The rise of API-first corporations, in fintech and past – TechCrunch

    The rise of API-first corporations, in fintech and past – TechCrunch

    QSTP-funded startup brings digital actuality to life

    QSTP-funded startup brings digital actuality to life

    Payglocal Funding: Cross-border funds startup PayGlocal raises $12 million from Tiger International, Sequoia

    Payglocal Funding: Cross-border funds startup PayGlocal raises $12 million from Tiger International, Sequoia

    [Funding alert] Fintech startup PayGlocal raises $12M from Tiger World, Sequoia, BEENEXT

    [Funding alert] Fintech startup PayGlocal raises $12M from Tiger World, Sequoia, BEENEXT

    With $110M in new funds, Aidoc is branching out of radiology

    With $110M in new funds, Aidoc is branching out of radiology

    Trending Tags

    • startup advice
    • startup funding
    • startup
    • funding
    • fund
    • Tips
  • Software & Development
    • All
    • Programming
    • Software Architecture
    • Web Security
    8 Knowledge Constructions That Energy Your Databases

    8 Knowledge Constructions That Energy Your Databases

    Let’s Architect! Architecting for governance and administration

    Let’s Architect! Designing event-driven architectures

    EP 42: Designing a chat utility

    EP 42: Designing a chat utility

    Textual content analytics on AWS: implementing an information lake structure with OpenSearch

    Textual content analytics on AWS: implementing an information lake structure with OpenSearch

    EP 41: What’s Kubernetes?

    EP 41: What’s Kubernetes?

    Streaming the AWS Wickr desktop consumer with Amazon AppStream 2.0

    Streaming the AWS Wickr desktop consumer with Amazon AppStream 2.0

    EP 40: Git workflow – by Alex Xu

    EP 40: Git workflow – by Alex Xu

    Genomics workflows, Half 4: processing archival information

    Genomics workflows, Half 4: processing archival information

    EP 39: Accounting 101 in Fee Techniques

    EP 39: Accounting 101 in Fee Techniques

    Prime 10 AWS Structure Weblog posts of 2022

    Prime 10 AWS Structure Weblog posts of 2022

    Trending Tags

    • Java
    • Microsoft
    • employee wellness programs
    • Project
    • Dev
    • Hackers
    • Security
  • Contact Us
No Result
View All Result
Startup News
Home Software & Development Programming

JVM C1, C2 Compiler Thread: Excessive CPU Consumption?

by Startupnews Writer
June 16, 2022
in Programming
0
JVM C1, C2 Compiler Thread: Excessive CPU Consumption?
492
SHARES
1.4k
VIEWS
Share on FacebookShare on Twitter


C1 and C2 compiler threads are created by a Java digital machine to optimize your software’s efficiency. Sometimes these threads will are likely to devour excessive CPU. On this publish, let’s be taught somewhat extra about C1 and C2 compiler threads and how one can deal with their excessive CPU consumption.

After studying this publish, terminologies like Hotspot JIT, C1 compiler threads, C2 compiler threads, and code cache might not terrify you (because it used to terrify me up to now).

C1 and C2 Compiler Thread image

What Is HotSpot JIT Compiler?

Your software might have thousands and thousands of strains of code. Nevertheless, solely a small subset of code will get executed many times. This small subset of code (often known as “HotSpot”) is liable for your software efficiency. At runtime, JVM makes use of this JIT (just-in-time) compiler to optimize this HotSpot code. More often than not, code written by the applying builders will not be optimum. Thus, JVM’s JIT compiler optimizes the developer’s code for higher efficiency. To do that optimization, the JIT compiler makes use of C1 and C2 compiler threads. 

What Is Code Cache? 

The reminiscence space that the JIT compiler makes use of for this code compilation is named “code cache.” This space resides exterior of the JVM heap and metaspace. To study completely different JVM reminiscence areas, it’s possible you’ll seek advice from this video clip.

What Is the Distinction Between C1 and C2 Compiler Threads?

 In the course of the early days of Java, there have been two varieties of JIT compilers:

  1. Shopper
  2. Server

Primarily based on what kind of JIT compiler you need to use, acceptable JDKs need to be downloaded and put in. If you’re constructing a desktop software, then JDK with a “consumer” JIT compiler must be downloaded. If you’re constructing a server software, then JDK that has a “server” JIT compiler must be downloaded.

Shopper JIT compiler begins compiling the code as quickly as the applying begins. Server JIT compiler will observe the code execution for fairly a while. Primarily based on the execution data it positive aspects, it is going to begin doing the JIT compilation. Though server JIT compilation is sluggish, the code it produces might be much more superior and performant than the one produced by the consumer JIT compiler.

In the present day trendy JDKs are shipped with each consumer and server JIT compilers. Each of the compilers attempt to optimize the applying code. In the course of the software startup time, code is compiled utilizing the consumer JIT compiler. Later as extra data is gained, code is compiled utilizing the server JIT compiler. That is known as tiered compilation in JVM. 

JDK builders had been calling them consumer and server JIT compilers, internally as C1 and C2 compilers. Thus, the threads utilized by the consumer JIT compiler are known as C1 compiler threads. Threads utilized by the server JIT compiler are known as C2 compiler threads.

C1, C2 Compiler Threads Default Dimension

The default variety of C1 and C2 compiler threads are decided primarily based on the variety of CPUs which might be accessible on the container/system during which your software is operating. Right here is the desk which summarizes the default variety of C1 and C2 compiler threads:

Default C1, C2 compiler thread count

Default C1, C2 compiler thread rely

You’ll be able to change the compiler thread rely by passing -XX:CICompilerCount=N JVM argument to your software. One-third of the rely you specify in -XX:CICompilerCount might be allotted to the C1 compiler threads. The remaining thread rely might be allotted to C2 compiler threads. Suppose you’ll 6 threads (i.e., -XX:CICompilerCount=6), then 2 threads might be allotted to C1 compiler threads and 4 threads might be allotted to C2 compiler threads.

C1, C2 Compiler Thread Excessive CPU Consumption: Potential Options

Typically you would possibly see C1 or C2 compiler threads devour a excessive quantity of CPU. When any such drawback surfaces, under are the potential answer to handle it:

1. Do Nothing (If Intermittent)

In your case, in case your C2 compiler thread’s CPU consumption is barely intermittently excessive and never repeatedly excessive, and it doesn’t damage your software’s efficiency, then you may think about ignoring the issue.

2. -XX:-TieredCompilation

Go this -XX:-TieredCompilation JVM argument to your software. This argument will disable the JIT HotSpot compilation. Thus CPU consumption will go down. Nevertheless, as a side-effect, your software’s efficiency can degrade.

3. -XX:TieredStopAtLevel=N

If a CPU spike is prompted due to C2 compiler threads alone, you may flip off C2 compilation alone. You’ll be able to move -XX:TieredStopAtLevel=3. If you move this -XX:TieredStopAtLevel argument with worth 3, then solely C1 compilation might be enabled and C2 compilation might be disabled. 

There are 4 tiers of compilations:

Four tiers of compilations

If you say -XX:TieredStopAtLevel=3, then code might be compiled solely as much as “Full C1 compiled code” degree. C2 compilation might be stopped.

4. -XX:+PrintCompilation

You’ll be able to move -XX:+PrintCompilation JVM argument to your software. It can print particulars about your software’s compilation course of. It can facilitate you to tune the compilation course of additional.

5. -XX:ReservedCodeCacheSize=N

The code that the Hotspot JIT compiler compiles/optimizes is saved within the code cache space of the JVM reminiscence. The default measurement of this code cache space is 240MB. You’ll be able to enhance it by passing -XX:ReservedCodeCacheSize=N to your software. To illustrate you need to make it 512 MB. You’ll be able to specify it like this: -XX:ReservedCodeCacheSize=512m. Rising the code cache measurement has the potential to cut back the CPU consumption of the compiler threads.

6. -XX:CICompilerCount

You’ll be able to think about rising the C2 compiler threads through the use of the argument -XX:CICompilerCount. You’ll be able to seize the thread dump and add it to instruments like fastThread.There you may see the variety of C2 compiler threads. If you happen to see a fewer variety of C2 compiler threads and you’ve got extra CPU processors/cores, you may enhance the C2 compiler thread rely by specifying -XX:CICompilerCount=8 argument.

Video



Source_link

Related

Tags: CompilerConsumptionCPUhighJVMThread
Share197Tweet123
Startupnews Writer

Startupnews Writer

We write full-time and bring you the best news for startups and enterprises. We are passionate about tech entrepreneurship & innovation. Here you will find also web security news and software architecture standards for your next project.

  • Trending
  • Comments
  • Latest
Why is RESTful API so widespread?

Why is RESTful API so widespread?

August 25, 2022
What do WhatsApp, Discord, and Fb Messenger have in frequent? (Episode 10)

What do WhatsApp, Discord, and Fb Messenger have in frequent? (Episode 10)

June 6, 2022
These local weather startups are nonetheless elevating cash regardless of Putin, inflation, markets – 24/7 Wall St.

These local weather startups are nonetheless elevating cash regardless of Putin, inflation, markets – 24/7 Wall St.

June 5, 2022
Acquisitions and investments within the funds trade: challenges and alternatives

A Standardized, Specification-Pushed API Lifecycle

June 5, 2022

Telematics Options Market Measurement to Surpass US$ 142.93

0
Acquisitions and investments within the funds trade: challenges and alternatives

Acquisitions and investments within the funds trade: challenges and alternatives

0
With Market Measurement Valued at $1.4 Billion by 2026, it`s a Wholesome Outlook for the World MEMS Oscillators Market

With Market Measurement Valued at $1.4 Billion by 2026, it`s a Wholesome Outlook for the World MEMS Oscillators Market

0
How Ukrainian startups are surviving the battle with Russia

How Ukrainian startups are surviving the battle with Russia

0
8 Knowledge Constructions That Energy Your Databases

8 Knowledge Constructions That Energy Your Databases

January 28, 2023
Let’s Architect! Architecting for governance and administration

Let’s Architect! Designing event-driven architectures

January 26, 2023
EP 42: Designing a chat utility

EP 42: Designing a chat utility

January 21, 2023
Textual content analytics on AWS: implementing an information lake structure with OpenSearch

Textual content analytics on AWS: implementing an information lake structure with OpenSearch

January 20, 2023
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

Copyright © 2022.

No Result
View All Result
  • Home
  • Startups
  • Software & Development
  • Contact Us

Copyright © 2022.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
What Are Cookies
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT
Translate »