简体   繁体   中英

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?

在此输入图像描述 在此输入图像描述

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 PrintStream s). Writes and flushes on a PrintStream cannot be processed in parallel, they are all synchronized, so you're facing contention.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM