Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thread contention on java.io.PrintStream

I am using Java Mission Control to profile my application for performance issues. JMC has highlighted java.io.PrintStream under Thread Contention and Lock Instances sections.

Why am I facing thread contention issues for JDK package?

enter image description here enter image description here

like image 729
ilovetolearn Avatar asked Aug 27 '16 06:08

ilovetolearn


1 Answers

It looks like your application is producing a lot of output to stdout or stderr from several threads concurrently (System.out and System.err are PrintStreams). Writes and flushes on a PrintStream cannot be processed in parallel, they are all synchronized, so you're facing contention.

like image 64
Andrew Lygin Avatar answered Nov 08 '22 08:11

Andrew Lygin