#### com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
##### target process not responding or HotSpot VM not loaded
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
1. Check whether the current user and the target java process are consistent. If they are inconsistent, switch to the same user. JVM can only attach java processes under the same user.
1. Check whether the current user and the target java process are consistent. If they are inconsistent, switch to the same user. JVM can only attach java processes under the same user.
2. Try to use `jstack -l $pid`. If the process does not respond, it means that the process may freeze and fail to respond to the JVM attach signal. So Arthas based on the attach mechanism cannot work. Try to use `jmap` heapdump to analyze.
2. Try to use `jstack -l $pid`. If the process does not respond, it means that the process may freeze and fail to respond to the JVM attach signal. So Arthas based on the attach mechanism cannot work. Try to use `jmap` heapdump to analyze.
<liclass="toctree-l2"><aclass="reference internal"href="#how-much-impact-does-arthas-attach-have-on-the-performance-of-the-original-process">How much impact does Arthas attach have on the performance of the original process?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#how-much-impact-does-arthas-attach-have-on-the-performance-of-the-original-process">How much impact does Arthas attach have on the performance of the original process?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#com-sun-tools-attach-attachnotsupportedexception-unable-to-open-socket-file-target-process-not-responding-or-hotspot-vm-not-loaded">com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded</a><ul>
<liclass="toctree-l2"><aclass="reference internal"href="#target-process-not-responding-or-hotspot-vm-not-loaded">target process not responding or HotSpot VM not loaded</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#can-commands-such-as-trace-watch-enhance-the-classes-in-jdk">Can commands such as trace/watch enhance the classes in jdk?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#can-commands-such-as-trace-watch-enhance-the-classes-in-jdk">Can commands such as trace/watch enhance the classes in jdk?</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#how-to-view-the-result-in-json-format">How to view the result in <codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> format</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#how-to-view-the-result-in-json-format">How to view the result in <codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> format</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#can-arthas-view-the-value-of-a-variable-in-memory">Can arthas view the value of a variable in memory?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#can-arthas-view-the-value-of-a-variable-in-memory">Can arthas view the value of a variable in memory?</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#how-to-filter-method-with-the-same-name">How to filter method with the same name?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#how-to-filter-method-with-the-same-name">How to filter method with the same name?</a></li>
<liclass="toctree-l3"><aclass="reference internal"href="#how-to-watch-or-trace-constructor">How to watch or trace constructor?</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="#how-to-watch-or-trace-constructor">How to watch or trace constructor?</a></li>
<liclass="toctree-l1"><aclass="reference external"href="https://github.com/alibaba/arthas">Star me at GitHub</a></li>
<liclass="toctree-l1"><aclass="reference external"href="https://github.com/alibaba/arthas">Star me at GitHub</a></li>
@ -205,36 +203,38 @@
<h2>How much impact does Arthas attach have on the performance of the original process?<aclass="headerlink"href="#how-much-impact-does-arthas-attach-have-on-the-performance-of-the-original-process"title="Permalink to this headline">¶</a></h2>
<h2>How much impact does Arthas attach have on the performance of the original process?<aclass="headerlink"href="#how-much-impact-does-arthas-attach-have-on-the-performance-of-the-original-process"title="Permalink to this headline">¶</a></h2>
<h2>com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded<aclass="headerlink"href="#com-sun-tools-attach-attachnotsupportedexception-unable-to-open-socket-file-target-process-not-responding-or-hotspot-vm-not-loaded"title="Permalink to this headline">¶</a></h2>
<h2>target process not responding or HotSpot VM not loaded<aclass="headerlink"href="#target-process-not-responding-or-hotspot-vm-not-loaded"title="Permalink to this headline">¶</a></h2>
<p>com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded</p>
<olclass="simple">
<olclass="simple">
<li><p>Check whether the current user and the target java process are consistent. If they are inconsistent, switch to the same user. JVM can only attach java processes under the same user.</p></li>
<li><p>Check whether the current user and the target java process are consistent. If they are inconsistent, switch to the same user. JVM can only attach java processes under the same user.</p></li>
<li><p>Try to use <codeclass="docutils literal notranslate"><spanclass="pre">jstack</span><spanclass="pre">-l</span><spanclass="pre">$pid</span></code>. If the process does not respond, it means that the process may freeze and fail to respond to the JVM attach signal. So Arthas based on the attach mechanism cannot work. Try to use <codeclass="docutils literal notranslate"><spanclass="pre">jmap</span></code> heapdump to analyze.</p></li>
<li><p>Try to use <codeclass="docutils literal notranslate"><spanclass="pre">jstack</span><spanclass="pre">-l</span><spanclass="pre">$pid</span></code>. If the process does not respond, it means that the process may freeze and fail to respond to the JVM attach signal. So Arthas based on the attach mechanism cannot work. Try to use <codeclass="docutils literal notranslate"><spanclass="pre">jmap</span></code> heapdump to analyze.</p></li>
<li><p>Try to attach arthas-demo in <aclass="reference internal"href="quick-start.html"><spanclass="doc">quick-start</span></a>.</p></li>
<li><p>Try to attach arthas-demo in <aclass="reference internal"href="quick-start.html"><spanclass="doc">quick-start</span></a>.</p></li>
<h3>Can commands such as trace/watch enhance the classes in jdk?<aclass="headerlink"href="#can-commands-such-as-trace-watch-enhance-the-classes-in-jdk"title="Permalink to this headline">¶</a></h3>
<h2>Can commands such as trace/watch enhance the classes in jdk?<aclass="headerlink"href="#can-commands-such-as-trace-watch-enhance-the-classes-in-jdk"title="Permalink to this headline">¶</a></h2>
<p>By default, classes beginning with <codeclass="docutils literal notranslate"><spanclass="pre">java.</span></code> are filtered out, but they can be turned on:</p>
<p>By default, classes beginning with <codeclass="docutils literal notranslate"><spanclass="pre">java.</span></code> are filtered out, but they can be turned on:</p>
<h3>How to view the result in <codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> format<aclass="headerlink"href="#how-to-view-the-result-in-json-format"title="Permalink to this headline">¶</a></h3>
<h2>How to view the result in <codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> format<aclass="headerlink"href="#how-to-view-the-result-in-json-format"title="Permalink to this headline">¶</a></h2>
<h3>Can arthas view the value of a variable in memory?<aclass="headerlink"href="#can-arthas-view-the-value-of-a-variable-in-memory"title="Permalink to this headline">¶</a></h3>
<h2>Can arthas view the value of a variable in memory?<aclass="headerlink"href="#can-arthas-view-the-value-of-a-variable-in-memory"title="Permalink to this headline">¶</a></h2>
<p>No. But you can use some tricks to intercept the object with the <codeclass="docutils literal notranslate"><spanclass="pre">tt</span></code> command, or fetch it from a static method.</p>
<p>No. But you can use some tricks to intercept the object with the <codeclass="docutils literal notranslate"><spanclass="pre">tt</span></code> command, or fetch it from a static method.</p>
<h3>How to filter method with the same name?<aclass="headerlink"href="#how-to-filter-method-with-the-same-name"title="Permalink to this headline">¶</a></h3>
<h2>How to filter method with the same name?<aclass="headerlink"href="#how-to-filter-method-with-the-same-name"title="Permalink to this headline">¶</a></h2>
<p>You can used all variables in <aclass="reference internal"href="advice-class.html"><spanclass="doc">fundamental fields in expressions</span></a> for the condition express to filter method with the same name, you can use the number of parameters <codeclass="docutils literal notranslate"><spanclass="pre">params.length</span><spanclass="pre">==1</span></code>,parameter type <codeclass="docutils literal notranslate"><spanclass="pre">params[0]</span><spanclass="pre">instanceof</span><spanclass="pre">java.lang.Integer</span></code>,return value type <codeclass="docutils literal notranslate"><spanclass="pre">returnObj</span><spanclass="pre">instanceof</span><spanclass="pre">java.util.List</span></code> and so on in one or more combinations as condition express.</p>
<p>You can used all variables in <aclass="reference internal"href="advice-class.html"><spanclass="doc">fundamental fields in expressions</span></a> for the condition express to filter method with the same name, you can use the number of parameters <codeclass="docutils literal notranslate"><spanclass="pre">params.length</span><spanclass="pre">==1</span></code>,parameter type <codeclass="docutils literal notranslate"><spanclass="pre">params[0]</span><spanclass="pre">instanceof</span><spanclass="pre">java.lang.Integer</span></code>,return value type <codeclass="docutils literal notranslate"><spanclass="pre">returnObj</span><spanclass="pre">instanceof</span><spanclass="pre">java.util.List</span></code> and so on in one or more combinations as condition express.</p>
<p>You can use <codeclass="docutils literal notranslate"><spanclass="pre">-v</span></code> to view the condition express result <aclass="reference external"href="https://github.com/alibaba/arthas/issues/1348">https://github.com/alibaba/arthas/issues/1348</a></p>
<p>You can use <codeclass="docutils literal notranslate"><spanclass="pre">-v</span></code> to view the condition express result <aclass="reference external"href="https://github.com/alibaba/arthas/issues/1348">https://github.com/alibaba/arthas/issues/1348</a></p>
<h3>java.lang.ClassFormatError: null, skywalking arthas compatible use<aclass="headerlink"href="#java-lang-classformaterror-null-skywalking-arthas-compatible-use"title="Permalink to this headline">¶</a></h3>
<h2>java.lang.ClassFormatError: null, skywalking arthas compatible use<aclass="headerlink"href="#java-lang-classformaterror-null-skywalking-arthas-compatible-use"title="Permalink to this headline">¶</a></h2>
<p>When error log appear <codeclass="docutils literal notranslate"><spanclass="pre">java.lang.ClassFormatError:</span><spanclass="pre">null</span></code>, it is usually modified by other bytecode tools that are not compatible with arthas modified bytecode.</p>
<p>When error log appear <codeclass="docutils literal notranslate"><spanclass="pre">java.lang.ClassFormatError:</span><spanclass="pre">null</span></code>, it is usually modified by other bytecode tools that are not compatible with arthas modified bytecode.</p>
<p>For example: use skywalking V8.1.0 below <aclass="reference external"href="https://github.com/alibaba/arthas/issues/1141">cannot trace, watch classes enhanced by skywalking agent</a>, V8.1.0 or above is compatible, refer to skywalking configuration for more details. <aclass="reference external"href="https://github.com/apache/skywalking/blob/v8.1.0/docs/en/FAQ/Compatible-with-other-javaagent-bytecode-processing">skywalking compatible with other javaagent bytecode processing</a>.</p>
<p>For example: use skywalking V8.1.0 below <aclass="reference external"href="https://github.com/alibaba/arthas/issues/1141">cannot trace, watch classes enhanced by skywalking agent</a>, V8.1.0 or above is compatible, refer to skywalking configuration for more details. <aclass="reference external"href="https://github.com/apache/skywalking/blob/v8.1.0/docs/en/FAQ/Compatible-with-other-javaagent-bytecode-processing">skywalking compatible with other javaagent bytecode processing</a>.</p>
<liclass="toctree-l2"><aclass="reference internal"href="#com-sun-tools-attach-attachnotsupportedexception-unable-to-open-socket-file-target-process-not-responding-or-hotspot-vm-not-loaded">com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded</a><ul>
<liclass="toctree-l2"><aclass="reference internal"href="#target-process-not-responding-or-hotspot-vm-not-loaded">target process not responding or HotSpot VM not loaded</a></li>
<h2>com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded<aclass="headerlink"href="#com-sun-tools-attach-attachnotsupportedexception-unable-to-open-socket-file-target-process-not-responding-or-hotspot-vm-not-loaded"title="永久链接至标题">¶</a></h2>
<h2>target process not responding or HotSpot VM not loaded<aclass="headerlink"href="#target-process-not-responding-or-hotspot-vm-not-loaded"title="永久链接至标题">¶</a></h2>
<p>com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded</p>