添加URL
相关文章推荐
follwinds  ·  ExtClassLoader的parent为 ...·  3 年前    · 
天涯  ·  IntelliJ IDEA ...·  3 年前    · 

引言: 在JVM的实际应用中,一般无法通过图形化的界面来进行JVM的观察和问题确定,一般都需要通过命令来进行,这里碰到的问题是无法连接上java进程....

1.  问题的提出

JDK 1.7, Java Web应用

2.  问题的提出

在尝试使用jmap进行探查的过程中,执行如下命令:

>> jmap 8765     [8765是我们通常使用的java应用进程号】

[xxx@xxx ~]$ jmap -heap 9683
Attaching to process ID 9683, please wait...
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process
3.  问题分析

正常来说,服务器上是使用标准的JDK基础包,无特殊设置,jmap是JVM自带的命令,无法连接上process,因为什么原因?

正常来说,肯定是可以的。

Java进程肯定存在的,没有消失。

难道是OS的权限屏蔽, 忽然意识到,我当前使用的是普通用户,而这个java进程是由root用户来启动的。

4.  问题解决

>> sudo su -

切换到root用户,重新执行jmap pid, 即可正常访问命令输出的内容了。

[xxxx@xxxx ~]# jmap heap 9683
Attaching to core 9683 from executable heap, please wait...
Error attaching to core file: Can't attach to the core file
[root@gyl-test-t5 ~]# jmap -heap 9683
Attaching to process ID 9683, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.71-b01
using thread-local object allocation.
Parallel GC with 23 thread(s)
Heap Configuration:
   MinHeapFreeRatio = 0
   MaxHeapFreeRatio = 100
   MaxHeapSize      = 1258291200 (1200.0MB)
   NewSize          = 1310720 (1.25MB)
   MaxNewSize       = 17592186044415 MB
   OldSize          = 5439488 (5.1875MB)
   NewRatio         = 2
   SurvivorRatio    = 8
   PermSize         = 268435456 (256.0MB)
   MaxPermSize      = 536870912 (512.0MB)
   G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
PS Young Generation
Eden Space:
   capacity = 310378496 (296.0MB)
   used     = 258040456 (246.08655548095703MB)
   free     = 52338040 (49.91344451904297MB)
   83.13734982464764% used
From Space:
   capacity = 45613056 (43.5MB)
   used     = 26470024 (25.24378204345703MB)
   free     = 19143032 (18.25621795654297MB)
   58.03168285852191% used
To Space:
   capacity = 46137344 (44.0MB)
   used     = 0 (0.0MB)
   free     = 46137344 (44.0MB)
   0.0% used
PS Old Generation
   capacity = 320339968 (305.5MB)
   used     = 259420512 (247.40267944335938MB)
   free     = 60919456 (58.097320556640625MB)
   80.98287379488032% used
PS Perm Generation
   capacity = 268435456 (256.0MB)
   used     = 96727704 (92.2467269897461MB)
   free     = 171707752 (163.7532730102539MB)
   36.03387773036957% used
Error attaching to process sun. jvm .hotspot.debugger.DebuggerException cannot open binary file
#环境 jdk1.8 Unable to open socket file: target process not responding or HotSpot VM not loaded 2.1 jvm 运行时会在/tmp目录下生成一个目录hsperfdat... 基础环境centos8+kubeadm1.20.5+cilium+hubble环境搭建,线上主要跑 php nodejs java 环境。 java pod昨天频繁出现了cpu 90% 占用率告警: ![image.png](https://img-blog.csdnimg.cn/img_convert/11c1cd0d40d5e5a5f442b32dd41ae915.png#clientId=u784d77f5-0778-4&from=paste&height=371&id
使用jinfo命令查看 RemoteMavenServer(Idea 一个 进程 ) 时报错: Error attaching to process: sun. jvm .hotspot.runtime.VMVersionMismatchException: Supported versions are 25.101-b13. Target VM is 25.152-b28 sun. jvm .hotspot...
问题 1、well-known file is not secure 问题 1、jdk内置命令strace:如:jstack 10975 >10975.txt (strace可以跟踪执行jstatck 过程) 2、jstack 10975 >10975.txt 执行命令后,报错信息:well-known file is not secure 问题 解决方法: a、第一个原因及解决方法:...
今天在创建堆dump时出现了异常, Error attaching to core file: cannot open binary file,具体 报错信息如下: [xxxxx]# jmap 29082 -dump:live,format=b,file=aaa Attaching to core -dump:live,format=b,file=aaa from executable 29082, please wait... Error attaching to core file: cannot o
Spring Boot之application.properites的failed to convert java.lang.String to java.lang.Integer问题解决 MicheleLi: <build> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <excludes> <exclude>**/application-dev.properties</exclude> <exclude>**/application-live.properties</exclude> <exclude>**/application-localdev.properties</exclude> <exclude>**/application-prelive.properties</exclude> <!-- <exclude>**/application-*.properties</exclude>--> </excludes> </resource> </resources> <plugins> <plugin> 确实是博主说的这个原因 NLTK下载语言素材中碰到的certificate verify failed (_ssl.c:749) tabula rasa: cd /Applications/Python 3.6 这是哪个路径啊 Python之ImportError: DLL load failed: 找不到指定的模块问题解决 m0_70716748: Python之ImportError: DLL load failed: 找不到指定的模块问题解决 weixin_45813729: 还得是这个贴才有用 URL地址中的中文乱码问题的解决 qq_52856994: 用restful风格模糊查询遇到这个问题了,只能搜索英文的,怎么解决