打开文件句柄太多 [英] Too many open file handles
问题描述
我正在开发一个庞大的遗留Java应用程序,有很多手写的东西,现在你可以让框架处理。
I'm working on a huge legacy Java application, with a lot of handwritten stuff, which nowadays you'd let a framework handle.
我现在面临的问题是我们的Solaris服务器上的文件句柄不足。我想知道跟踪打开文件句柄的最佳方法是什么?在哪里查看以及什么可能导致打开文件句柄用完?
The problem I'm facing right now is that we are running out of file handles on our Solaris Server. I'd like to know what's the best way to track open file handles? Where to look at and what can cause open file handles to run out?
我无法在Solaris下调试应用程序,仅在我的Windows开发环境中调试。分析Windows下的打开文件句柄是否合理?
I cannot debug the application under Solaris, only on my Windows development environment. Is is even reasonable to analyze the open file handles under Windows?
推荐答案
我发现有一件好事可以追踪未关闭的文件句柄是FindBugs:
One good thing I've found for tracking down unclosed file handles is FindBugs:
http://findbugs.sourceforge.net /
它会检查很多东西,但其中最有用的是资源打开/关闭操作。它是一个静态分析程序,运行在您的源代码上,它也可以作为eclipse插件使用。
It checks many things, but one of the most useful is resource open/close operations. It's a static analysis program that runs on your source code and it's also available as an eclipse plugin.
这篇关于打开文件句柄太多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!