Jstack Error – Not enough storage available

JStack is nice tool to print thread stack traces for a given java process. It comes to be very handy when analyzing high cpu usage problems. At times when executing this command you may encounter an error like I did 🙂

“Not enough storage is available to process this command”

It appears that on Windows Vista and later jstack doesn’t work because the command might be executed from a different user account then the one under which the jvm is running. The error doesn’t have anything to do with memory. So possible solutions to this are

  1. Run jstack under the same account as the jvm
  2. Use psexec to execute the jstack command like
psexec -s "%JAVA_HOME%\bin\jstack.exe" PID >stack.txt

Hope that helps !

Advertisements

Posted on August 20, 2012, in java and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: