zoukankan      html  css  js  c++  java
  • JVM performance profiling (有待整理)

    Agenda

    memory model

    3 parts: heap, permgen (method area) , thread stack(pointer, local var)

    heap: young and old generation ?? permanent generation 

    young: eden, fromspace(surviror1), tospace(surironr2)


    == quoted ==

    To get the clear memory diagram:http://blog.pointsoftware.ch/index.php/under-the-hood-runtime-data-areas-javas-memory-model/

    http://www.yourkit.com/docs/kb/sizes.jsp

    http://www.slideshare.net/gengmao/inside-the-jvm-memory-management-and-troubleshooting  

    PermGen

    The method area is also known as the permanent generation space (PermGen). Allclass data are loaded into this memoryspace. This includes the field and method data and the code for the methods andconstructors

    Heapmemory

    Sinceobjects are stored in the heap part it is worth to have a closer look. The heapspace itself is again separated into several spaces:

    -Young generation  with eden and survivor space

    -Old Generation with tenured space

    Eachspace harbors objects with different life cycles:

    -New/short-term objects are instantiated in theeden space.

    -Survived/mid-term objects are copied from theeden space to the survivor space.

    - Tenured/long-term objects arecopied from the survivor to the old generation space.

    == unquoted ==


    jvm setting

    GC algorithm: serial, ... etc, MaxNewSize,  MaxSize ,  there is recommendation online, client side, server side and diff platform.

    JavaOne: best heap percent :43% ??


    tunning concerns

    availablility  , throughput, latency and responsiveness, memory footprint (100 txn need how many mem?), startup time


    real time profiling

    Remote
    Add JMX parameter to bootstrap script


    $JAVA_HOME/bin/java ${GC_OPTS}
    -Dcom.sun.management.jmxremote  
    -Dcom.sun.management.jmxremote.port=9010
    -Dcom.sun.management.jmxremote.local.only=false
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false
    -classpath $PROJ_CLASSPATH ${BOOTSTRAPPER} ${PARAMETER}

    Local 

    VisualVM/Jconsole is able to detect the running JAVA application process id..

    http://www.gamlor.info/wordpress/2011/09/visualvm/

    Eclipse for VisualVM (https://visualvm.java.net/eclipse-launcher.html)

    JMX profile ?! - linux svr profile , like shell

    server port number?!  - need ask server team

    Will it cause the app slowness? - yes, occupy CPU


    post gc analysis

    Enable the verbose:gc option in the bootstrap script

    -verbose:gc

    -Xms512m -Xmx1024m

    -XX:+PrintGCTimestamps

    -XX:+PrintGCDetails

    -Xloggc:./${GC_LOG}

    After the log file generated, you can use the tool to analyse. - GC Histogram Tool

    All GC

    Young GC - GC in young generation ?

    Full GC - 


    Good tips:

    Eclipse plugin center - for you to goto there via company proxy, 

    1. check from stackoverflow site - Add parm into eclipse.ini  ;

    2. disable socket proxy port


    Websphere JVM profiling on app server

    Ask WAS team to install a was plugin into for monitor

  • 相关阅读:
    [已解决]报错:Failed to restart network.service: Unit network.service not found
    [已解决]PostgreSQL报错:cannot begin/end transactions in PL/pgSQL解决方法
    Navicat连接Hive
    [已解决]报错:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
    [已解决]报错:Unknown system variable 'query_cache_size'
    [已解决]报错: Unable to load authentication plugin 'caching_sha2_password'.
    python小练习
    Oracle消除重复记录的几种方式
    Android支持ARM架构软件包安装Genymotion-ARM-Translation_for_8.0
    Centos7上安装DBDIFF
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3270921.html
Copyright © 2011-2022 走看看