java - C2 Compiler saturating CPU at startup -



java - C2 Compiler saturating CPU at startup -

i have java servlet application on java 7 healthy in terms of scheme resource consumption. cpu usage on server below 50%. in few minutes next startup behaves much differently, point cpu can become pegged @ 100% several minutes if trying serve lot of traffic during period. result slow response times, network timeouts, , long garbage collection pauses sometimes.

to diagnose issue, took series of thread dumps while server starting , ran top -h @ same time. matching each java thread pid, can consistently see c2 compilerthread using far cpu. have done research thread , understand java compiler optimizing code based on runtime statistics. reading i've done, can't tell best approach making situation better. options can glean are:

switch c2 tieredcompiler (but result in improve performance in first few minutes after startup?) turn on -xx:+printcompilation see beingness optimized (but do information? can forcefulness optimized before server accepting traffic somehow?)

what best approach take , there other options seek , alleviate cpu usage after startup?

there several paid-for jvm technology available alleviate problem, using ahead-of-time compilation.

however, if want stick standard jvms, 1 trick people utilize after startup send few dummy requests jvm warmed before actual operation starts. way can decide when want pay jvm warm-up cost before serving customers.

you can force jvm compile code -xcomp command line options hotspot, we don't recommend it slow downwards start of application compiling seldomly used code.

java performance jvm

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -