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:
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
Post a Comment