• JDK内嵌指令的简单学习


    java


    • 可以使用 java -jar的方式启动服务
    • 日常工作中用到的比较少

    javac


    • 可以将.java 文件编译成 .class中间代码
    • 这个工具开发编写代码中是经常需要使用的, jenkins 或者是 gitlab-ci 都是使用这个命令编译源代码到 class文件.

    jar


    • 可以将一个project 下面的所有的class等文件以及元数据等信息使用zip或者是其他压缩格式打包成.jar文件.
    • 也可以将多个jar包打包成一个合并的jar包提供.

    jps


    • 显示当前机器(物理机或者是虚拟机)运行的java进程信息,以及启动的核心类或者是jar包.

    jinfo


    • 可以显示当前运行jvm的启动参数以及配置信息等.
      jinfo -flags pid

    jcmd


      command must be a valid jcmd command for the selected jvm.      
      Use the command "help" to see which commands are available.   
      If the pid is 0, commands will be sent to all Java processes.   
      The main class argument will be used to match (either partially 
      or fully) the class used to start Java.                         
      If no options are given, lists Java processes (same as -p).  
    
    • 直接运行jcmd 能够展示出运行的jvm
    • jcmd pid help 能够看到具体的命令
    • 感觉这一块的东西非常全面了, 几乎所有的
    [root@centos76oracle19c ~]# jcmd 1465 help
    1465:
    The following commands are available:
    VM.native_memory
    ManagementAgent.stop
    ManagementAgent.start_local
    ManagementAgent.start
    VM.classloader_stats
    GC.rotate_log
    Thread.print
    GC.class_stats
    GC.class_histogram
    GC.heap_dump
    GC.finalizer_info
    GC.heap_info
    GC.run_finalization
    GC.run
    VM.uptime
    VM.dynlibs
    VM.flags
    VM.system_properties
    VM.command_line
    VM.version
    help
    
    • 直接使用就可以了.

    jmap


    • 能够显示堆区,以及导入dump文件等.
    jmap -heap pid
    展示堆区新区
    jmap -histo pid
    查看类信息等.
    jmap -dump:format=b,file=/root/20210827.dump pid
    能够导出dump信息.
    

    jstat


    • jstat 能够 展示实时统计信息.这里面可以总结一下
    jstat -class pid 
    # 展示类信息
    jstat -complier pid
    # 展示编译器的信息
    jstat -gc pid
    #展示gc的信息
    jstat -gccapacity pid
    #堆内存统计
    jstat -gcnew pid
    jstat -gcnewcapacity pid
    jstat -gcold pid
    jstat -gcoldcapacity  pid
    jstat -gcmetacapacity pid
    jstat -gcutil pid
    jstat -printcompilation pid
    

  • 相关阅读:
    Spring>autoWire
    hibernate>多对多关联映射
    Hibernate>一级缓存
    Hibernate>component映射和复合主键映射
    Struts2>类型转换
    hibernate>继承
    hibernate>悲观锁和乐观锁
    Spring>Bean的作用域
    Struts2>defaultactionref
    数据库的隔离级别
  • 原文地址:https://www.cnblogs.com/jinanxiaolaohu/p/15192723.html
Copyright © 2020-2023  润新知