Blog Archives

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 !