Bizzare threading blocks creating primitive arrays

Recently, we had a situation where a production machine was going down with a massive landfill. This is a tarry web server, and it gave "Full Java HotSpot (TM) dump stream 64-bit VM server (mixed mode 14.0-b16):".

There are tons of BLOCKED streams, but they bother me. IE, one is as follows:

"resin-8576" daemon prio=10 tid=0x00007f871827b800 nid=0x6b5 waiting for monitor entry [0x00007f864a7e6000] java.lang.Thread.State: BLOCKED (on object monitor) at java.lang.String.toCharArray(String.java:2725) at java.lang.Thread.setName(Thread.java:1051) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:605) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649) at java.lang.Thread.run(Thread.java:619) 

The code has

 char result[] = new char[count]; 

The other one looks like

 "resin-8574" daemon prio=10 tid=0x00007f8718277800 nid=0x6b3 waiting for monitor entry [0x00007f864a9e8000] java.lang.Thread.State: BLOCKED (on object monitor) at java.lang.String.valueOf(String.java:2840) at java.lang.Thread.getName(Thread.java:1061) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:603) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649) at java.lang.Thread.run(Thread.java:619) 

Where is the String code

 return new String(data); 

Strange places seem to be blocked.

Can anyone suggest a reason why these calls are blocked?

Thanks, -kal

+4
source share
1 answer

It looks like this method can be called a lot and generate a lot of garbage. When the GC runs these methods that can allocate objects, they can be blocked while the GC is waiting.

I would try a more modern JVM. e.g. Java 6 update 24 (has a JVM build of 19 or 20), since you seem to have an older JVM installed.

+2
source

Source: https://habr.com/ru/post/1345129/


All Articles