'Not enough storage is available to process this command' thrown when using jstack to generate external thread dumps
You may be instructed by Atlassian Support to generate a thread dump using the jstack tool on a Windows platform. This error is thrown when trying to execute the command.
Jstack only allows you to connect to JVM's running in the same user context. Many people use a service wrapper to start their products: this puts the JVM in the Local System Account user context. Since this special account has no login shell, you won't be able to force a thread dump normally.
Change the service wrapper to use another account. Do this from Services>Apache Tomcat Confluence>Properties.
Use Psexec to execute the jstack command as the relevant user.
psexec -s "%JAVA_HOME%\bin\jstack.exe" PID >stack.txt
Follow the Live Monitoring Using the JMX Interface directions and set up a JMX monitoring tool like visualVM acting remotely on the JVM. Many of these tools can generate thread dumps externally.