sun.rmi.server.LoaderHandler.urlsToPath() 占用大量 CPU
我正在尝试优化一个进行大量 RMI 调用的应用程序。根据 JProfiler 的说法,超过 30% 的 CPU 时间花费在 sun.rmi.server.LoaderHandler.urlsToPath()
方法上,该方法显然是在封送过程中被调用的。该方法调用 URL.toExternalForm()
这正常吗?我还没有弄清楚哪些对象正在被准确序列化,但这似乎是一个奇怪的瓶颈。
LoadHandler.urlsToPath()
的用途是什么?我可以采取哪些措施来减少其使用?
I'm trying to optimize an app that makes a lot of RMI calls. According to JProfiler, more than 30% of the CPU time is spent in the sun.rmi.server.LoaderHandler.urlsToPath()
method, which is apparently getting called during marshaling. This method calls URL.toExternalForm()
Is that normal? I haven't yet figured out which objects are getting serialized exactly, but it seems like an odd bottleneck.
What is the purpose of LoadHandler.urlsToPath()
, and what can I do to reduce its usage?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过 Google 搜索“sun.rmi.server.LoaderHandler.java”发现了这一点。
简单来说,它是 String bashing。您需要查看应用程序调用此函数的上下文,以找出为何如此频繁地调用它,但这很可能是进行大量 RMI 调用的直接结果。如果是这样,解决方案将是减少 RMI 调用,或者使用 RMI 以外的其他方法。
I found this with a Google search for "sun.rmi.server.LoaderHandler.java"
In simple terms it is String bashing. You'd need to look at the context in which your application is calling this to figure out why it is being called so often, but the chances are that this is a direct consequence of doing lots of RMI calls. If so, the solution will be to do fewer RMI calls, or to use something other than RMI.