Jstack 和没有足够的存储空间来处理此命令

发布于 2024-07-21 05:35:30 字数 163 浏览 8 评论 0原文

我正在尝试在我的 java 应用程序上运行 jstack 命令。 应用程序比较大,运行在jboss AS内部,占用内存约4GB。 操作系统为Windows Server 2003标准版。 每次我收到错误“没有足够的存储空间来处理此命令”。 有足够的 RAM、16GB 和磁盘空间。 那么,有什么想法吗?

I'm trying to run jstack command on my java application. Application is rather big, running inside jboss AS occupying about 4gb of memory. OS is Windows Server 2003 Standard edition. Every time i get an error "Not enough storage is available to process this command". There is enough ram, 16gb, and disk space. So, any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

谁许谁一生繁华 2024-07-28 05:35:30

我最近在 Win2008r2 上遇到了这个问题,并认为我应该分享我的解决方案,因为花了一段时间才弄清楚。 Rob 关于 psexec -s 的评论 就是为我做的。

由于用户上下文的原因,在 Vista 和更高版本上,jstack 似乎不适用于服务。 它与记忆无关。 我怀疑这与人们在 2003 年通过远程桌面看到此问题的原因相同,除非您在 mstsc 上使用 /admin 或 /console 开关。 从 Vista 开始,加强的安全性可能是破坏它的原因。

从 cmd 窗口启动我的应用程序工作正常,但这并不能帮助我调试我们的标准安装。 启用 java 调试端口(对于 VisualVM、Eclipse 或大多数 Java 调试器)需要重新启动应用程序,因此如果您尚未启用调试,您可能会丢失可能尝试捕获的状态。 在我的用户凭据下启动服务不起作用 - 我对此有点惊讶。 但是 psexec -s 从系统上下文运行 jstack,这就像一个魅力。 哦,如果 UAC 已打开,您将需要从提升的 cmd 提示符运行 psexec。

I ran into this recently on Win2008r2 and thought I'd share my solution since it took a while to figure out. Rob's comment about psexec -s is what did it for me.

It appears that on Vista and later jstack doesn't work against services because of the user context. It has nothing to do with memory. I suspect this is the same reason people have seen this problem on 2003 via remote desktop, unless you use the /admin or /console switch on mstsc. As of Vista the tightened security is probably what broke it.

Starting my app from a cmd window worked fine, but that doesn't help me debug our standard install. Enabling the java debug port (for VisualVM, Eclipse or most any Java debugger) requires an app restart, so you lose the state you're probably trying to capture if you don't already have debugging enabled. Starting the service under my user credentials did not work - I was a little surprised at that. But psexec -s runs jstack from the system context, which worked like a charm. Oh, and you'll need to run psexec from an elevated cmd prompt, if UAC is on.

罪歌 2024-07-28 05:35:30

过去,当 JVM 在 Windows 2003 上作为 Windows 服务运行时,我曾见过这种情况。

首先,检查这是否是 TMP 目录问题

其次,jstack(或 jconsole 等其他实用程序)不会连接到本地进程,除非它在同一会话中运行。 如果服务以特定用户身份运行,您可以通过登录同一会话进行连接。 如果您使用远程桌面,您可以使用“mstsc /admin”(以前是/console)连接并尝试再次运行jstack。 如果这不能解决问题,请务必检查以确保 TMP 目录设置正确。

如果服务作为 LocalSystem 运行,则上述过程可能不会有太大帮助。 我不知道是否有办法登录到与 LocalSystem 相同的会话。

其他一些替代方案可能是将进程设置为远程监控,并使用 jvisualvm(从服务器本身或另一台机器)通过端口连接并执行线程转储。

In the past I have seen this when the JVM is running as a Windows Service on Windows 2003.

First, check to see if this is an issue with the TMP directory.

Second, jstack (or the other utilities like jconsole) will not connect to the local process unless it is running in the same session. If the service is running as a specific user, you may be able to connect by logging into the same session. If you are using Remote Desktop, you can connect using "mstsc /admin" (used to be /console) and try to run jstack again. Definitely check to make sure the TMP directory is set properly if this doesn't fix the problem.

If the service is running as LocalSystem, the above procedure probably will not help much. I don't know if there is a way to log into the same session as LocalSystem.

Some other alternatives may be to set the process up for remote monitoring and use jvisualvm (from the server itself or another machine) to connect over a port and do a thread dump.

仄言 2024-07-28 05:35:30

我们在 Windows 机器上运行 JStack 时遇到了问题,即使是一个普通的应用程序 (1GB)。 我们最终使用 Netbeans 进行了堆栈和堆分析。 这似乎可以更好地处理转储文件的解析。 YMMV。

尝试一下 Netbeans 进行分析 - 它非常好。 请注意,VisualVM 是精简版 NB 分析器,随 6u7 一起提供。

We had problems running JStack on a Windows machine with even a modest application (1GB). We ended up doing our stack and heap analysis using Netbeans. This seemed to cope with the parsing of dump files a lot better. YMMV.

Give Netbeans a try for profiling - its very good. Note that VisualVM is a cutdown NB profiler and comes with 6u7.

一个人练习一个人 2024-07-28 05:35:30

psexec -s jstack PID>> c:\jstack.log 在同一台机器上完美运行。 第一次花了一些时间,但我再次使用重定向到文件选项执行,它在几秒钟内完成。

psexec -s jstack PID >> c:\jstack.log perfectly works on the same machine. For the first time it took some time but again I executed with the redirect to file option, it completed with in few seconds.

七婞 2024-07-28 05:35:30

这是来自底层操作系统的错误消息。 除了捕获引发的异常之外,您在代码中无能为力来处理此问题。 Windows 的局限性实在是太大了。

http://technet.microsoft.com/en-us/library/cc978735。 ASPX

This is an error message from the underlying O/S. There's not much you can do in your code to deal with this other than catch the exception which is thrown. Boo to Windows for being so limited.

http://technet.microsoft.com/en-us/library/cc978735.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文