zoukankan      html  css  js  c++  java
  • Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process 异常处理

    When you need to attach process to jmap you might get following error here i have described how we can avoid that.

    Run fllowing to get process ID
     :jps
    3252 Bootstrap
    3513 Jps

    Then run following to execute jmap

    $ jmap -heap:format=b 3252
    Attaching to process ID 3252, please wait...
    Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process

    Then to avoid error run following

    $ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

    Then run again above command

    $ jmap -heap:format=b 3252
    Attaching to process ID 3252, please wait...
    Debugger attached successfully.
    Server compiler detected.
    JVM version is 17.0-b16
    
    using thread-local object allocation.
    Parallel GC with 4 thread(s)
    
    Heap Configuration:
       MinHeapFreeRatio = 40
       MaxHeapFreeRatio = 70
       MaxHeapSize      = 1073741824 (1024.0MB)
       NewSize          = 1310720 (1.25MB)
       MaxNewSize       = 17592186044415 MB
       OldSize          = 5439488 (5.1875MB)
       NewRatio         = 2
       SurvivorRatio    = 8
       PermSize         = 21757952 (20.75MB)
       MaxPermSize      = 268435456 (256.0MB)
    
    Heap Usage:
    PS Young Generation
    Eden Space:
       capacity = 263847936 (251.625MB)
       used     = 226730648 (216.2271957397461MB)
       free     = 37117288 (35.397804260253906MB)
       85.93231822742021% used
    From Space:
       capacity = 36372480 (34.6875MB)
       used     = 16924568 (16.140525817871094MB)
       free     = 19447912 (18.546974182128906MB)
       46.53124560106982% used
    To Space:
       capacity = 40763392 (38.875MB)
       used     = 0 (0.0MB)
       free     = 40763392 (38.875MB)
       0.0% used
    PS Old Generation
       capacity = 333053952 (317.625MB)
       used     = 179019752 (170.7265396118164MB)
       free     = 154034200 (146.8984603881836MB)
       53.75097665858053% used
    PS Perm Generation
       capacity = 151519232 (144.5MB)
       used     = 93595192 (89.25933074951172MB)
       free     = 57924040 (55.24066925048828MB)
       61.771163148451016% used


    You will see correct output

    文章出处:

    http://sanjeewamalalgoda.blogspot.hk/2014/01/how-to-avoid-jmap-error-error-attaching.html

  • 相关阅读:
    ASP获取客户端硬件信息(CPU、硬盘、主板、mac地址等)
    Java(多态)动手动脑
    每周进度条(第二周)
    Java(异常处理)动手动脑
    软件工程概论课后作业1
    mysqlmmm官方安装指南翻译
    Mysql 字符集的修改步骤
    Amoeba搞定mysql主从读写分离
    邮件系统postfix安装和设置
    mysqlmmm实现mysql高可用
  • 原文地址:https://www.cnblogs.com/seanvon/p/3924007.html
Copyright © 2011-2022 走看看