Reasons for high CPU usage in SocketInputStream.socketRead0()

前端 未结 2 1671
陌清茗
陌清茗 2021-02-12 18:07

While profiling homegrown web-application I came across following very strange (at least for me) observation.

Almost all time is spent in socketRead0() meth

2条回答
  •  花落未央
    2021-02-12 18:37

    VisualVM shows load not as an absolute value but as a relative value, so it simply means that your application does not have any more CPU-consuming point.

    I believe you should configure VisualVM to not drill that deep down, and rather count this method call as part of a method that is in your code (or spring's).

    I have already experienced such a behaviour, but it didn't look like it was requiring any optimization. The Web Application simply has to read data from sockets (i.e. HTTP Request, database, internal network services...) and there is no helping it.

提交回复
热议问题