0

I am trying to run jstack and jmd inside an AWS ECS container (EC2 based, not fargate) for some debugging. The container is running a Springboot based application. I have verified that jcmd and jstack are present, but I am getting following error:

/opt/java/openjdk # /usr/lib/jvm/default-jvm/bin/jcmd 1 Thread.print > /tmp/thread_dump.txt
Picked up JAVA_TOOL_OPTIONS: -XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,readonly,nonFatal
Unrecognized VM option 'IdleTuningGcOnIdle'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
/opt/java/openjdk # /usr/lib/jvm/default-jvm/bin/jcmd 7 Thread.print > /tmp/thread_dump.txt
Picked up JAVA_TOOL_OPTIONS: -XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningGcOnIdle -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,readonly,nonFatal
Unrecognized VM option 'IdleTuningGcOnIdle'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Can someone please help?

Sumit Jindal
  • 363
  • 1
  • 7
  • 17

1 Answers1

0

There is an environment variable JAVA_TOOL_OPTIONS defined in your container or VM which is setting the argument -XX:+IdleTuningGcOnIdle. That argument is not supported by the Java version your container has. Remove that argument from the environment variable to solve the issue.

aled
  • 21,330
  • 3
  • 27
  • 34
  • I tried that, but then it complained for the second option as well, so I removed that too. Now, it ended up throwing a new error: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded – Sumit Jindal May 25 '23 at 13:16
  • That's a different issue. Please open a new question. – aled May 25 '23 at 14:00