SlideShare uma empresa Scribd logo
1 de 102
Profilers
                        Ferramentas de Monitoração




Sunday, June 27, 2010
2
Sunday, June 27, 2010
Objetivo

             Compreender os principais conceitos de profiling
              de código e o funcionamento das ferramentas
                   mais relevantes do mundo Java EE.




                                                               3
Sunday, June 27, 2010
Profilers deveriam ser ferramentas de
       uso das equipes de desenvolvimento.




                                              4
Sunday, June 27, 2010
Profilers são ferramentas usadas pelas equipes
                          de infra-estrutura para se protegerem de
                                         maus códigos.




                                                                        5
Sunday, June 27, 2010
HPROF
                                            Heap Profiler

              The Heap Profiler (HPROF) tool is a simple profiler
               agent shipped with the JDK release.(...)The HPROF
                  tool is capable of presenting CPU usage, heap
             allocation statistics, and monitor contention profiles. In
                addition, it can report complete heap dumps and
                states of all the monitors and threads in the Java
                virtual machine. In terms of diagnosing problems,
               HPROF is useful when analyzing performance, lock
                   contention, memory leaks, and other issues.

                  http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tooldescr.html#gblvj   6
Sunday, June 27, 2010
$   java -agentlib:hprof=help
             HPROF: Heap and CPU Profiling Agent (JVMTI Demonstration Code)

  hprof usage: java -agentlib:hprof=[help]|[<option>=<value>, ...]

  Option Name and Value        Description                      Default
  ---------------------        -----------                      -------
  heap=dump|sites|all          heap profiling                   all
  cpu=samples|times|old        CPU usage                        off
  monitor=y|n                  monitor contention               n
  format=a|b                   text(txt) or binary output       a
  file=<file>                  write data to file               java.hprof[{.txt}]
  net=<host>:<port>            send data over a socket          off
  depth=<size>                 stack trace depth                4
  interval=<ms>                sample interval in ms            10
  cutoff=<value>               output cutoff point              0.0001
  lineno=y|n                   line number in traces?           y
  thread=y|n                   thread in traces?                n
  doe=y|n                      dump on exit?                    y
  msa=y|n                      Solaris micro state accounting   n
  force=y|n                    force output to <file>           y
  verbose=y|n                  print messages about dumps       y
  ...

                                                                                     7
Sunday, June 27, 2010
Regra geral

      java -agentlib:hprof=... NomeDaClasse


                        Ctrl+C        Ctrl+
                        shutdown




                            java.hprof.txt
                                               8
Sunday, June 27, 2010
$ JVM_ARGS="-agentlib:hprof=heap=sites" ./jmeter.sh

THREAD START (obj=50000143, id = 200001, name="main", group="main")
THREAD START (obj=500013d1, id = 200004, name="Java2D Disposer", group="system")
THREAD START (obj=5000191f, id = 200005, name="AWT-XAWT", group="main")
THREAD START (obj=5000195f, id = 200006, name="Image Fetcher 0", group="main")
...
THREAD END (id = 200008)
...
TRACE 300000:
!    <empty>
TRACE 300001:
!    java.lang.Thread.<init>(Thread.java:432)
TRACE 300002:
!    java.lang.Thread.<init>(Thread.java:208)
TRACE 300003:
!    java.lang.String.toCharArray(String.java:2726)
!    java.lang.Thread.init(Thread.java:349)
!    java.lang.Thread.<init>(Thread.java:433)
....
SITES BEGIN (ordered by live bytes) Wed May 27 07:34:16 2009
           percent          live          alloc'ed stack class
  rank   self accum      bytes objs     bytes objs trace name
     1 9,88% 9,88%     2486200    3   2486200     3 317684 int[]
     2 2,13% 12,01%     535440 6693    535760 6697 310354 javax.swing.text.html.InlineView
     3 2,07% 14,08%     521592 159     623912   168 306967 char[]
     4 1,78% 15,86%     447696 18654    450672 18778 305960 java.awt.Rectangle
     5 1,72% 17,58%     432240 18010    599808 24992 310036 java.util.Hashtable$Entry
                                                                                  java.hprof.txt
                                                                                              9
Sunday, June 27, 2010
$ JVM_ARGS="-agentlib:hprof=heap=dump" ./jmeter.sh


...
OBJ 50036a21 (sz=24, trace=309881, class=javax.swing.text.html.StyleSheet
$SmallConversionSet@5000e518)
!    attributes!   50036a22
!    this$0! !     5000b0d6
!    this$0! !     5000b0d6
ARR 50036a22 (sz=32, trace=309882, nelems=4, elem type=java.lang.Object[]@500000a0)
!    [0]! !   5000da97
!    [1]! !   50065782
!    [2]! !   50007706
!    [3]! !   5000dae2
OBJ 50036a23 (sz=40, trace=310897, class=javax.swing.text.html.HTMLDocument$BlockElement@5000f3eb)
!    parent! !     50036901
!    attributes!   500107d4
!    this$0! !     5000b16d
!    children!50031212
!    this$0! !     5000b16d
!    this$0! !     5000b16d
OBJ 50036a24 (sz=392, trace=306854, class=javax.swing.JLabel@50000868)
OBJ 50036a25 (sz=8, trace=306855, class=java.lang.Object@5000009f)
OBJ 50036a26 (sz=8, trace=306856, class=java.lang.Object@5000009f)
OBJ 50036a27 (sz=24, trace=300098, class=java.util.ArrayList@5000005b)
ARR 50036a28 (sz=56, trace=305084, nelems=0, elem type=java.lang.Object[]@500000a0)
OBJ 50036a29 (sz=16, trace=306857, class=javax.swing.event.EventListenerList@50002745)
OBJ 50036a2a (sz=24, trace=306356, class=java.lang.ref.WeakReference@50000037)
...

                                                                                      java.hprof.txt

                                                                                                  10
                                                                                                   9
Sunday, June 27, 2010
$ JVM_ARGS="-agentlib:hprof=cpu=samples" ./jmeter.sh




...
CPU SAMPLES             BEGIN (total =   1564) Wed May 27 07:38:42 2009
rank    self             accum   count   trace method
    1 48,47%            48,47%     758   300482 sun.awt.X11.XToolkit.waitForEvents
    2 2,56%             51,02%      40   300104 java.lang.ClassLoader.defineClass1
    3 1,15%             52,17%      18   300001 java.lang.ClassLoader.findBootstrapClass
    4 1,09%             53,26%      17   301617 sun.awt.X11.XInputMethod.openXIMNative
    5 0,77%             54,03%      12   300513 java.util.zip.Inflater.inflateBytes
    6 0,77%             54,80%      12   300778 java.awt.EventQueue.postEventPrivate
    7 0,77%             55,56%      12   300834 sun.font.FileFont.getGlyphImage
    8 0,70%             56,27%      11   301388 java.lang.Class.forName0
...
                                                                                java.hprof.txt




                                                                                            11
Sunday, June 27, 2010
$ JVM_ARGS="-agentlib:hprof=cpu=samples" ./jmeter.sh




...
CPU SAMPLES             BEGIN (total =   1564) Wed May 27 07:38:42 2009
rank    self             accum   count   trace method
    1 48,47%            48,47%     758   300482 sun.awt.X11.XToolkit.waitForEvents
    2 2,56%             51,02%      40   300104 java.lang.ClassLoader.defineClass1
    3 1,15%             52,17%      18   300001 java.lang.ClassLoader.findBootstrapClass
    4 1,09%             53,26%      17   301617 sun.awt.X11.XInputMethod.openXIMNative
    5 0,77%             54,03%      12   300513 java.util.zip.Inflater.inflateBytes
    6 0,77%             54,80%      12   300778 java.awt.EventQueue.postEventPrivate
    7 0,77%             55,56%      12   300834 sun.font.FileFont.getGlyphImage
    8 0,70%             56,27%      11   301388 java.lang.Class.forName0
...
                                                                                java.hprof.txt


                                            amostragem


                                                                                            11
Sunday, June 27, 2010
$ JVM_ARGS="-agentlib:hprof=cpu=times" ./jmeter.sh




...
CPU TIME (ms) BEGIN (total = 1743936) Wed May 27 07:44:33 2009
rank    self accum   count trace method
    1 16,23% 16,23%    458 306106 java.lang.ref.ReferenceQueue.remove
    2 16,21% 32,44%     40 306095 java.lang.Object.wait
    3 16,18% 48,63%     52 317114 java.lang.ref.ReferenceQueue.remove
    4 14,79% 63,42%      1 393892 java.util.TimerThread.mainLoop
    5 7,67% 71,10%       1 391291 java.lang.Object.wait
    6 2,97% 74,07%      37 312015 sun.awt.image.ImageFetcher.nextImage
    7 0,74% 74,81%      50 320365 java.lang.Object.wait
...
                                                               java.hprof.txt




                                                                           12
Sunday, June 27, 2010
$ JVM_ARGS="-agentlib:hprof=cpu=times" ./jmeter.sh




...
CPU TIME (ms) BEGIN (total = 1743936) Wed May 27 07:44:33 2009
rank    self accum   count trace method
    1 16,23% 16,23%    458 306106 java.lang.ref.ReferenceQueue.remove
    2 16,21% 32,44%     40 306095 java.lang.Object.wait
    3 16,18% 48,63%     52 317114 java.lang.ref.ReferenceQueue.remove
    4 14,79% 63,42%      1 393892 java.util.TimerThread.mainLoop
    5 7,67% 71,10%       1 391291 java.lang.Object.wait
    6 2,97% 74,07%      37 312015 sun.awt.image.ImageFetcher.nextImage
    7 0,74% 74,81%      50 320365 java.lang.Object.wait
...
                                                               java.hprof.txt


                           valores exatos


                                                                           12
Sunday, June 27, 2010
$ export JAVA_OPTS="-agentlib:hprof=monitor=y"
$ ./catalina.sh run                                                              java.hprof.txt
THREAD START (obj=5000013e, id = 200001, name="main", group="main")
WAIT: MONITOR Ljava/lang/ref/Reference$Lock;, timeout=0, thread 200003
WAIT: MONITOR Ljava/lang/ref/ReferenceQueue$Lock;, timeout=0, thread 200004
WAITED: MONITOR Ljava/lang/ref/Reference$Lock;, time_waited=678, thread 200003
WAIT: MONITOR Ljava/lang/ref/Reference$Lock;, timeout=0, thread 200003
WAITED: MONITOR Ljava/lang/ref/ReferenceQueue$Lock;, time_waited=677, thread 200004
WAIT: MONITOR Ljava/lang/ref/ReferenceQueue$Lock;, timeout=0, thread 200004
WAITED: MONITOR Ljava/lang/ref/Reference$Lock;, time_waited=117, thread 200003
...
MONITOR DUMP BEGIN
    THREAD 200001, trace 300804, status: native|R
    THREAD 200002, trace 300000, status: ZO
    THREAD 200003, trace 300210, status: CW
    THREAD 200004, trace 300212, status: CW
    THREAD 200006, trace 300805, status: SL
    THREAD 200007, trace 300000, status: ZO
...
    MONITOR Ljava/net/SocksSocketImpl;
!   owner: thread 200001, entry count: 1
!   waiting to enter:
!   waiting to be notified:
    MONITOR Ljava/lang/Shutdown$Lock;
!   owner: thread 200013, entry count: 1
!   waiting to enter:
!   waiting to be notified:
    MONITOR Ljava/lang/Class;
!   owner: thread 200013, entry count: 1
!   waiting to enter:
!   waiting to be notified:
MONITOR DUMP END                                                                            13
Sunday, June 27, 2010
jboss-4.2.2.GA/bin $ tail -3 run.conf
# Ativacao do HPROF
JAVA_OPTS="$JAVA_OPTS -agentlib:hprof=cpu=samples,file=jboss.hprof.txt"

jboss-4.2.2.GA/bin $ ./run.sh
=========================================================================

   JBoss Bootstrap Environment                                            Parâmetro
                                                                        configurado no
   JBOSS_HOME: /Users/alegomes/jbtun/app/jboss-4.2.2.GA
                                                                            JBoss...
   JAVA: /Library/Java/Home/bin/java

  JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -
Dsun.rmi.dgc.server.gcInterval=3600000 -Dcom.sun.management.jmxremote -
Djboss.platform.mbeanserver -
Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -
agentlib:hprof=cpu=samples,file=jboss.hprof.txt

   CLASSPATH: /Users/alegomes/jbtun/app/jboss-4.2.2.GA/bin/run.jar

=========================================================================

08:36:39,356 INFO [Server] Starting JBoss (MX MicroKernel)...
08:36:39,368 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA
date=200710221139)
...
08:38:53,308 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
08:38:53,402 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA
date=200710221139)] Started in 2m:13s:890ms
                                                                ...mas nada demais aconteceu.   14
Sunday, June 27, 2010
Ctrl + 


                        jboss.hprof.txt
                                          15
Sunday, June 27, 2010
java.hprof.txt
JAVA PROFILE 1.0.1, created Wed May 27 07:33:19 2009

Header for -agentlib:hprof (or -Xrunhprof) ASCII Output (JDK 5.0 JVMTI based)

@(#)jvm.hprof.txt! 1.5 06/01/28

 Copyright (c) 2006 Sun Microsystems, Inc. All   Rights Reserved.

WARNING! This file format is under development, and is subject to
change without notice.

This file contains the following types of records:

...

                                                     documentação no
                                                      próprio arquivo
                                                          gerado
                                                                                16
Sunday, June 27, 2010
THREAD START
           THREAD END   mark the lifetime of Java threads



THREAD        START (obj=5000013f,   id   =   200001,   name="main", group="main")
THREAD        START (obj=5000013f,   id   =   200005,   name="Java2D Disposer", group="system")
THREAD        START (obj=5000013f,   id   =   200006,   name="AWT-XAWT", group="main")
THREAD        START (obj=5000013f,   id   =   200007,   name="Image Fetcher 0", group="main")
THREAD        START (obj=5000013f,   id   =   200008,   name="Image Fetcher 1", group="main")
THREAD        START (obj=5000013f,   id   =   200009,   name="Image Fetcher 2", group="main")
THREAD        START (obj=5000013f,   id   =   200010,   name="AWT-Shutdown", group="main")
THREAD        START (obj=500005e7,   id   =   200011,   name="AWT-EventQueue-0", group="main")
THREAD        END (id = 200008)
THREAD        END (id = 200007)
THREAD        END (id = 200009)
THREAD        END (id = 200010)
THREAD        END (id = 200011)


                                                                                             17
Sunday, June 27, 2010
TRACE                 represents a Java stack trace. Each trace consists
                        of a series of stack frames. Other records refer to
                        TRACEs to identify (1) where object allocations have
                        taken place, (2) the frames in which GC roots were
                        found, and (3) frequently executed methods.


 TRACE 306106:
 !   java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line)
 !   java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line)
 !   java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:Unknown line)
 TRACE 306095:
 !   java.lang.Object.wait(Object.java:Unknown line)
 !   java.lang.ref.Reference$ReferenceHandler.run(Reference.java:Unknown line)
 TRACE 317114:
 !   java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line)
 !   java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line)
 !   sun.java2d.Disposer.run(Disposer.java:Unknown line)
 !   java.lang.Thread.run(Thread.java:Unknown line)




                                                                                 18
Sunday, June 27, 2010
HEAP DUMP                    is a complete snapshot of all live objects in the Java
                                 heap. Following distinctions are made:

                        ROOT root set as determined by GC
                        CLS classes
                        OBJ instances
                        ARR arrays




     OBJ    50036a24    (sz=392, trace=306854, class=javax.swing.JLabel@50000868)
     OBJ    50036a25    (sz=8, trace=306855, class=java.lang.Object@5000009f)
     OBJ    50036a26    (sz=8, trace=306856, class=java.lang.Object@5000009f)
     OBJ    50036a27    (sz=24, trace=300098, class=java.util.ArrayList@5000005b)
     ARR    50036a28    (sz=56, trace=305084, nelems=0, elem type=java.lang.Object[]@500000a0)
     OBJ    50036a29    (sz=16, trace=306857, class=javax.swing.event.EventListenerList@50002745)
     OBJ    50036a2a    (sz=24, trace=306356, class=java.lang.ref.WeakReference@50000037)




                                                                                                    19
Sunday, June 27, 2010
SITES                 is a sorted list of allocation sites. This identifies
                        the most heavily allocated object types, and the TRACE
                        at which those allocations occurred.




  SITES BEGIN (ordered by live bytes) Wed May 27 07:34:16 2009
            percent          live          alloc'ed stack class
   rank   self accum      bytes objs     bytes objs trace name
      1 9,88% 9,88%     2486200    3   2486200     3 317684 int[]
      2 2,13% 12,01%     535440 6693    535760 6697 310354 javax.swing.text.html.InlineView
      3 2,07% 14,08%     521592 159     623912   168 306967 char[]
      4 1,78% 15,86%     447696 18654    450672 18778 305960 java.awt.Rectangle
      5 1,72% 17,58%     432240 18010    599808 24992 310036 java.util.Hashtable$Entry
      6 1,69% 19,27%     426240 3330    426368 3331 309154 javax.swing.text.html.ParagraphView




                                                                                           20
Sunday, June 27, 2010
NetBeans Profiler



            “
                           The NetBeans profiler provides expert
                         assistance for optimizing your application's
                        speed and memory usage, and makes it
                         easier to build reliable and scalable Java SE,
                              JavaFX and Java EE applications.




                               http://www.netbeans.org/features/java/profiler.html   21
Sunday, June 27, 2010
WebApp




                                     Inicializa a
                                 aplicação web em
                                 modo de profiling


                                                    22
Sunday, June 27, 2010
Qual método gastou mais
                        tempo de processamento
                          durante a bateria de
                                testes?




                                                  23
Sunday, June 27, 2010
Memória
                               vs
                        Garbage Collector




                                            24
Sunday, June 27, 2010
Memória disponível
                               x
                         Memória em uso




                                             25
Sunday, June 27, 2010
Threads alocadas
                                 x
                        Classes carregadas




                                             26
Sunday, June 27, 2010
Quais objetos
                        ocuparam mais
                          memória?




                                        27
Sunday, June 27, 2010
Threads alocadas




                                           28
Sunday, June 27, 2010
Acabou a memória
                           disponível.




                                           29
Sunday, June 27, 2010
Mesmo erro no log
                          do Tomcat do
                            NetBeans




                                            30
Sunday, June 27, 2010
The Eclipse

                        Test & Performance
                          Tools Platform
                                        (TPTP)


                 The Eclipse Test and Performance Tools Platform
                      (TPTP) Project provides an open platform
                  supplying powerful frameworks and services that
                 allow software developers to build unique test and
                     performance tools, both open source and
                 commercial, that can be easily integrated with the
                            platform and with other tools.

                                 http://www.eclipse.org/tptp/         31
Sunday, June 27, 2010
32
Sunday, June 27, 2010
instalação do plugin via
                            software update




                                                   33
Sunday, June 27, 2010
atenção ao
                         servidor




                               TPTP




                                      34
Sunday, June 27, 2010
pacotes que
                serão instalados




                                   35
Sunday, June 27, 2010
última
                        checagem...




                                      36
Sunday, June 27, 2010
37
Sunday, June 27, 2010
...
                              38
Sunday, June 27, 2010
39
Sunday, June 27, 2010
http://www.eclipse.org/tptp/
                          home/downloads/4.5.0/
                           documents/quicktour/
                          WTP_viewlet20061206/
                        WTP_viewlet20061206.swf

                                                       40
Sunday, June 27, 2010
Usando HPROF, NetBeans ou Eclipse,
                realizar o profiling da alguma aplicação web Java
                     durante uma sessão de testes de carga.        41
Sunday, June 27, 2010
JProfiler




              “           JProfiler's intuitive GUI helps you find
                          performance bottlenecks, pin
                          down memory leaks and resolve
                                          threading issues.



                        http://www.ej-technologies.com/products/jprofiler/overview.html   42
Sunday, June 27, 2010
1 desenvolvedor




                        N desenvolvedores




                                            43
Sunday, June 27, 2010
Tempo de execução de
                    cada método




                                       44
Sunday, June 27, 2010
Tempo de execução de
                    cada método




                                       44
Sunday, June 27, 2010
Número de
                        instâncias de cada
                              classe




                                             45
Sunday, June 27, 2010
Número de
                        instâncias de cada
                              classe




                                             45
Sunday, June 27, 2010
Grafo de
                        referências entre
                             objetos
                                            46
Sunday, June 27, 2010
Grafo de
                        referências entre
                             objetos
                                            46
Sunday, June 27, 2010
Invocação entre
          métodos




                         47
Sunday, June 27, 2010
Invocação entre
          métodos




                         47
Sunday, June 27, 2010
Memória consumida
                         por cada método




                                            48
Sunday, June 27, 2010
Memória consumida
                         por cada método




                                            48
Sunday, June 27, 2010
Threads do
                         servidor



                                     49
Sunday, June 27, 2010
Threads do
                         servidor



                                     49
Sunday, June 27, 2010
Quais threads estão
                        sendo bloqueadas e por
                                  quê.




                                                 50
Sunday, June 27, 2010
Quais threads estão
                        sendo bloqueadas e por
                                  quê.




                                                 50
Sunday, June 27, 2010
51
Sunday, June 27, 2010
51
Sunday, June 27, 2010
JBoss Profiler




   “                     JBoss Profiler is a log based profiler using
                        JVMPI and JVMTI. It uses an agent written in C
                        that captures events from the JVM and logs to
                           disk. A web application running on JBoss or
                        another machine can be used to analyze these
                                   logs through a web browser.



                                    http://www.jboss.org/jbossprofiler/   52
Sunday, June 27, 2010
JBoss Profiler
                             instalação




               unzip jboss-profiler-2.0.Beta3.SP1.zip




                                                        53
Sunday, June 27, 2010
JBoss Profiler
                                            instalação


                 • Copiar para JBOSS_HOME/bin
                   • jboss-profiler.jar,
                   • jboss-profiler.properties,
                   • jboss-profiler-plugins.jar

                 • Copiar para JBOSS_HOME/server/<conf>/deploy
                   • jboss-profiler.sar

                 •      Se JBoss 4.2x, copie para JBOSS_HOME/bin:
                        •   javassist.jar
                                                                    54
Sunday, June 27, 2010
JBoss Profiler
                                        instalação


  • Em JBOSS_HOME/bin/jboss-profiler.properties

                    # Pacote a ser monitorado pelo Profiler
                    includes=br.com.seatecnologia.jbosstuning.*


  • Em JBOSS_HOME/bin/run.conf

               # Ativacao do JBoss Profiler
               JAVA_OPTS="$JAVA_OPTS
                           -javaagent:jboss-profiler.jar
                           -Djboss-profiler.properties=jboss-profiler.properties"

                                                                                55
Sunday, June 27, 2010
JBoss Profiler
                             instalação




                          Reinicialize o JBoss




                              Ctrl+C

                                                 56
Sunday, June 27, 2010
JBoss Profiler
                                      utilização


     • Inicie o JBoss Profiler
          java -jar jboss-profiler-client.jar startProfiler


     • Execute a aplicação
          Hora de executar o plano de teste do JMeter


     • Pare o JBoss Profiler
          java -jar jboss-profiler-client.jar stopProfiler


     • Colete os dados para análise
          java -jar jboss-profiler-client.jar getSnapshot 1

                                                              57
Sunday, June 27, 2010
java -jar jboss-profiler-client.jar getSnapshot 1

      Diretório criado




                                                           Arquivos com os
                                                        resultados do profiling




                              Diretório de instalação
                                 do jboss-profiler


                                                                                 58
Sunday, June 27, 2010
Duração do teste


                        Thread mais demorada    Métodos mais
                                                demorados




                                               Métodos que mais
                                                usaram a CPU



                                                                  59
Sunday, June 27, 2010
Nova interface Web do
                           JBossProfiler2




                                                60
Sunday, June 27, 2010
MBeans do
                           JBoss Profiler
                        (jboss-profiler.sar)




                                              61
Sunday, June 27, 2010
Operações do JBoss
                        Profiler via MBean




                                             62
Sunday, June 27, 2010
Twiddle:
--------
Information:
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   Running
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   Enabled
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   Memory
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   File
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   EJB
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   Servlet
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   JSF
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   JMX
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   RMI
  ./twiddle.sh          get   'org.jboss.profiler:service=Profiler'   CORBA

Operations:
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   startProfiler
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   stopProfiler
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   enableProfiler
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   disableProfiler
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   clearSnapshots
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   addClasses org.jboss.test.* public
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   removeClasses org.jboss.test.*
  ./twiddle.sh          invoke   'org.jboss.profiler:service=Profiler'   listClasses




                                                                                                        63
Sunday, June 27, 2010
YourKit




         “                  With YourKit solutions, both CPU and
                         memory profiling have come to the highest
                          professional level, where one can profile even
                        huge applications with maximum productivity and
                                          zero overhead.



                                       http://www.yourkit.com/            64
Sunday, June 27, 2010
65
Sunday, June 27, 2010
66
Sunday, June 27, 2010
Informe a licença que foi
                            enviada por email.



                                                    67
Sunday, June 27, 2010
Tela de
                        configuração
                                      68
Sunday, June 27, 2010
Nenhum aplicativo
                                           para profiling




                        Conectar a JEE
                         Server Local

                                                             69
Sunday, June 27, 2010
Escolha o
                        servidor a ser
                         monitorado
                                         70
Sunday, June 27, 2010
Configurações
                          específicas do
                        servidor escolhido
                                             71
Sunday, June 27, 2010
Script de
                         inicialização do
                        servidor gerado
                           pelo YourKit




                                            72
Sunday, June 27, 2010
JBoss
                            automaticamente
                               identificado




                        http://www.yourkit.com/docs/80/help/   73
Sunday, June 27, 2010
Primeira tela do
                     profiler




                                    74
Sunday, June 27, 2010
Após iniciar o
                         profiling de
                           CPU...
                                         ...estatísticas de
                                           execução são
                                          apresentadas.




                                                              75
Sunday, June 27, 2010
Ao final dos testes, salve os
                        dados coletados para análise
                              mais detalhada.




                                                       76
Sunday, June 27, 2010
77
Sunday, June 27, 2010
Métodos invocados
              por cada thread




                                 78
Sunday, June 27, 2010
Métodos que mais
              consumiram CPU




                                 79
Sunday, June 27, 2010
Lista de todos os
           métodos executados
            durante os testes




                                80
Sunday, June 27, 2010
Análise de JSPs e
                  Servlets




                                  81
Sunday, June 27, 2010
Uso da memória




                              82
Sunday, June 27, 2010
Como o GC se
               comportou.




                             83
Sunday, June 27, 2010
Habilitar
                        telemetria de
                           threads




                                        84
Sunday, June 27, 2010
Threads do
               conector HTTP




                               85
Sunday, June 27, 2010
Captura dados da
             memória para
              análise fina.




                               86
Sunday, June 27, 2010
Abra o snapshot
                            criado


                                          87
Sunday, June 27, 2010
88
Sunday, June 27, 2010
Dicas para otimização
                            da memória




                                            89
Sunday, June 27, 2010
Em todas as telas há links
                        diretos para a documentação
                               da ferramenta

                                                       90
Sunday, June 27, 2010
Já sabem o
                        que fazer, né?
                              ;-)



                                         91
Sunday, June 27, 2010
Q&A
Sunday, June 27, 2010

Mais conteúdo relacionado

Mais procurados

Александр Белокрылов. Java 8: Create The Future
Александр Белокрылов. Java 8: Create The FutureАлександр Белокрылов. Java 8: Create The Future
Александр Белокрылов. Java 8: Create The Future
Volha Banadyseva
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
knight1128
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascript
Miao Siyu
 

Mais procurados (20)

Threads v3
Threads v3Threads v3
Threads v3
 
Do we need Unsafe in Java?
Do we need Unsafe in Java?Do we need Unsafe in Java?
Do we need Unsafe in Java?
 
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(上)JCConf 2015  - 輕鬆學google的雲端開發 - Google App Engine入門(上)
JCConf 2015 - 輕鬆學google的雲端開發 - Google App Engine入門(上)
 
Александр Белокрылов. Java 8: Create The Future
Александр Белокрылов. Java 8: Create The FutureАлександр Белокрылов. Java 8: Create The Future
Александр Белокрылов. Java 8: Create The Future
 
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
FITC Web Unleashed 2017 - Introduction to the World of Testing for Front-End ...
 
An Introduction to the World of Testing for Front-End Developers
An Introduction to the World of Testing for Front-End DevelopersAn Introduction to the World of Testing for Front-End Developers
An Introduction to the World of Testing for Front-End Developers
 
rsyslog v8: more than just syslog!
rsyslog v8: more than just syslog!rsyslog v8: more than just syslog!
rsyslog v8: more than just syslog!
 
Google Guava
Google GuavaGoogle Guava
Google Guava
 
Nantes Jug - Java 7
Nantes Jug - Java 7Nantes Jug - Java 7
Nantes Jug - Java 7
 
Java.lang.object
Java.lang.objectJava.lang.object
Java.lang.object
 
Down the rabbit hole, profiling in Django
Down the rabbit hole, profiling in DjangoDown the rabbit hole, profiling in Django
Down the rabbit hole, profiling in Django
 
Python na Infraestrutura 
MySQL do Facebook

Python na Infraestrutura 
MySQL do Facebook
Python na Infraestrutura 
MySQL do Facebook

Python na Infraestrutura 
MySQL do Facebook

 
Introduction to JavaFX 2
Introduction to JavaFX 2Introduction to JavaFX 2
Introduction to JavaFX 2
 
Metaprogramming in julia
Metaprogramming in juliaMetaprogramming in julia
Metaprogramming in julia
 
Google Guava - Core libraries for Java & Android
Google Guava - Core libraries for Java & AndroidGoogle Guava - Core libraries for Java & Android
Google Guava - Core libraries for Java & Android
 
Java Concurrency and Asynchronous
Java Concurrency and AsynchronousJava Concurrency and Asynchronous
Java Concurrency and Asynchronous
 
JavaFX, because you're worth it
JavaFX, because you're worth itJavaFX, because you're worth it
JavaFX, because you're worth it
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
Javascript Common Design Patterns
Javascript Common Design PatternsJavascript Common Design Patterns
Javascript Common Design Patterns
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascript
 

Destaque

Are you paying attention suzanne montazer
Are you paying attention suzanne montazerAre you paying attention suzanne montazer
Are you paying attention suzanne montazer
SuzanneLMontazer
 
TheTemperature of Light
TheTemperature of LightTheTemperature of Light
TheTemperature of Light
Janise Yntema
 
99 140624013641-phpapp01 2
99 140624013641-phpapp01 299 140624013641-phpapp01 2
99 140624013641-phpapp01 2
Usama Waly
 
Optimization of physical parameters of α amylase producing brevibacillus boro...
Optimization of physical parameters of α amylase producing brevibacillus boro...Optimization of physical parameters of α amylase producing brevibacillus boro...
Optimization of physical parameters of α amylase producing brevibacillus boro...
eSAT Journals
 

Destaque (19)

Loomio how to Series - Working on a Discussion
Loomio how to Series - Working on a DiscussionLoomio how to Series - Working on a Discussion
Loomio how to Series - Working on a Discussion
 
Gerentes em Crise existencial - Existimos no Universo Ágil?
Gerentes em Crise existencial - Existimos no Universo Ágil?Gerentes em Crise existencial - Existimos no Universo Ágil?
Gerentes em Crise existencial - Existimos no Universo Ágil?
 
4. Liferay JSP Portlets
4. Liferay JSP Portlets4. Liferay JSP Portlets
4. Liferay JSP Portlets
 
Agilidade no Governo
Agilidade no GovernoAgilidade no Governo
Agilidade no Governo
 
O curioso caso de Náutilus Button
O curioso caso de Náutilus ButtonO curioso caso de Náutilus Button
O curioso caso de Náutilus Button
 
2. Liferay Overview
2. Liferay Overview2. Liferay Overview
2. Liferay Overview
 
Misc Monitoring Tools
Misc Monitoring ToolsMisc Monitoring Tools
Misc Monitoring Tools
 
Novidades do Liferay Portal 6.2
Novidades do Liferay Portal 6.2Novidades do Liferay Portal 6.2
Novidades do Liferay Portal 6.2
 
3. Liferay Customization
3. Liferay Customization3. Liferay Customization
3. Liferay Customization
 
Liferay Portal 6.2
Liferay Portal 6.2Liferay Portal 6.2
Liferay Portal 6.2
 
Roadshow Liferay no Brasil 2010
Roadshow Liferay no Brasil 2010Roadshow Liferay no Brasil 2010
Roadshow Liferay no Brasil 2010
 
Loomio how to Series - Creating a new Group of People
Loomio how to Series - Creating a new Group of PeopleLoomio how to Series - Creating a new Group of People
Loomio how to Series - Creating a new Group of People
 
Sem tesão não há solução
Sem tesão não há soluçãoSem tesão não há solução
Sem tesão não há solução
 
Are you paying attention suzanne montazer
Are you paying attention suzanne montazerAre you paying attention suzanne montazer
Are you paying attention suzanne montazer
 
TheTemperature of Light
TheTemperature of LightTheTemperature of Light
TheTemperature of Light
 
20131001 CBA between CBP and NTEU (revised version)
20131001 CBA between CBP and NTEU (revised version) 20131001 CBA between CBP and NTEU (revised version)
20131001 CBA between CBP and NTEU (revised version)
 
Edición, literatura costarricense y bibliodiversidad
Edición, literatura costarricense y bibliodiversidadEdición, literatura costarricense y bibliodiversidad
Edición, literatura costarricense y bibliodiversidad
 
99 140624013641-phpapp01 2
99 140624013641-phpapp01 299 140624013641-phpapp01 2
99 140624013641-phpapp01 2
 
Optimization of physical parameters of α amylase producing brevibacillus boro...
Optimization of physical parameters of α amylase producing brevibacillus boro...Optimization of physical parameters of α amylase producing brevibacillus boro...
Optimization of physical parameters of α amylase producing brevibacillus boro...
 

Semelhante a Java Profiling Tools

Pygrunn 2012 down the rabbit - profiling in python
Pygrunn 2012   down the rabbit - profiling in pythonPygrunn 2012   down the rabbit - profiling in python
Pygrunn 2012 down the rabbit - profiling in python
Remco Wendt
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Fixing the Java Serialization Mess
Fixing the Java Serialization Mess Fixing the Java Serialization Mess
Fixing the Java Serialization Mess
Salesforce Engineering
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
Michael Barker
 

Semelhante a Java Profiling Tools (20)

Pygrunn 2012 down the rabbit - profiling in python
Pygrunn 2012   down the rabbit - profiling in pythonPygrunn 2012   down the rabbit - profiling in python
Pygrunn 2012 down the rabbit - profiling in python
 
運用CNTK 實作深度學習物件辨識 Deep Learning based Object Detection with Microsoft Cogniti...
運用CNTK 實作深度學習物件辨識 Deep Learning based Object Detection with Microsoft Cogniti...運用CNTK 實作深度學習物件辨識 Deep Learning based Object Detection with Microsoft Cogniti...
運用CNTK 實作深度學習物件辨識 Deep Learning based Object Detection with Microsoft Cogniti...
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Why GC is eating all my CPU?
Why GC is eating all my CPU?Why GC is eating all my CPU?
Why GC is eating all my CPU?
 
Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance Diagnostics
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Fixing the Java Serialization Mess
Fixing the Java Serialization Mess Fixing the Java Serialization Mess
Fixing the Java Serialization Mess
 
devday2012
devday2012devday2012
devday2012
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 
Activator and Reactive at Play NYC meetup
Activator and Reactive at Play NYC meetupActivator and Reactive at Play NYC meetup
Activator and Reactive at Play NYC meetup
 
Java
JavaJava
Java
 
Locks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerLocks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael Barker
 
Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!Lock? We don't need no stinkin' locks!
Lock? We don't need no stinkin' locks!
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recap
 
Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존Java/Spring과 Node.js의공존
Java/Spring과 Node.js의공존
 
MLConf 2013: Metronome and Parallel Iterative Algorithms on YARN
MLConf 2013: Metronome and Parallel Iterative Algorithms on YARNMLConf 2013: Metronome and Parallel Iterative Algorithms on YARN
MLConf 2013: Metronome and Parallel Iterative Algorithms on YARN
 

Mais de SEA Tecnologia

A escola do século XXI deve ser ágil, enxuta e empreendedora.
A escola do século XXI deve ser ágil, enxuta e empreendedora.A escola do século XXI deve ser ágil, enxuta e empreendedora.
A escola do século XXI deve ser ágil, enxuta e empreendedora.
SEA Tecnologia
 
Open data, scraping e thacks com Software Livre
Open data, scraping e thacks com Software LivreOpen data, scraping e thacks com Software Livre
Open data, scraping e thacks com Software Livre
SEA Tecnologia
 
Roadshow Brasília Novas funcionalidades Liferay 6
Roadshow Brasília Novas funcionalidades Liferay 6Roadshow Brasília Novas funcionalidades Liferay 6
Roadshow Brasília Novas funcionalidades Liferay 6
SEA Tecnologia
 
Pra você, desenvolver software é atividade intelectual?
Pra você, desenvolver software é atividade intelectual?Pra você, desenvolver software é atividade intelectual?
Pra você, desenvolver software é atividade intelectual?
SEA Tecnologia
 
Jopr Plugin Development
Jopr Plugin DevelopmentJopr Plugin Development
Jopr Plugin Development
SEA Tecnologia
 
Arsenal de ferramentas para performance tuning
Arsenal de ferramentas para performance tuningArsenal de ferramentas para performance tuning
Arsenal de ferramentas para performance tuning
SEA Tecnologia
 

Mais de SEA Tecnologia (20)

Loomio how to Series - Creating a new Discussion
Loomio how to Series - Creating a new DiscussionLoomio how to Series - Creating a new Discussion
Loomio how to Series - Creating a new Discussion
 
Contratos de desenvolvimento de software para governo blue pill or red pill?
Contratos de desenvolvimento de software para governo  blue pill or red pill?Contratos de desenvolvimento de software para governo  blue pill or red pill?
Contratos de desenvolvimento de software para governo blue pill or red pill?
 
#Fail
#Fail#Fail
#Fail
 
Os benefícios e desafios da participação pública digital
Os benefícios e desafios da participação pública digitalOs benefícios e desafios da participação pública digital
Os benefícios e desafios da participação pública digital
 
A escola do século XXI deve ser ágil, enxuta e empreendedora.
A escola do século XXI deve ser ágil, enxuta e empreendedora.A escola do século XXI deve ser ágil, enxuta e empreendedora.
A escola do século XXI deve ser ágil, enxuta e empreendedora.
 
Lean Startup
Lean StartupLean Startup
Lean Startup
 
Open Data
Open DataOpen Data
Open Data
 
Open data, scraping e thacks com Software Livre
Open data, scraping e thacks com Software LivreOpen data, scraping e thacks com Software Livre
Open data, scraping e thacks com Software Livre
 
Agilidade dos projetos à empresa, uma história de Intracontágio
Agilidade dos projetos à empresa, uma história de IntracontágioAgilidade dos projetos à empresa, uma história de Intracontágio
Agilidade dos projetos à empresa, uma história de Intracontágio
 
Roadshow Brasília Novas funcionalidades Liferay 6
Roadshow Brasília Novas funcionalidades Liferay 6Roadshow Brasília Novas funcionalidades Liferay 6
Roadshow Brasília Novas funcionalidades Liferay 6
 
Empreendimentos em Rede
Empreendimentos em RedeEmpreendimentos em Rede
Empreendimentos em Rede
 
Cozinha
CozinhaCozinha
Cozinha
 
Pra você, desenvolver software é atividade intelectual?
Pra você, desenvolver software é atividade intelectual?Pra você, desenvolver software é atividade intelectual?
Pra você, desenvolver software é atividade intelectual?
 
Jopr Plugin Development
Jopr Plugin DevelopmentJopr Plugin Development
Jopr Plugin Development
 
JMX Management Tools
JMX Management ToolsJMX Management Tools
JMX Management Tools
 
Hotspot tools
Hotspot toolsHotspot tools
Hotspot tools
 
Unix Monitoring Tools
Unix Monitoring ToolsUnix Monitoring Tools
Unix Monitoring Tools
 
Benchmarking Tools
Benchmarking ToolsBenchmarking Tools
Benchmarking Tools
 
Arsenal de ferramentas para performance tuning
Arsenal de ferramentas para performance tuningArsenal de ferramentas para performance tuning
Arsenal de ferramentas para performance tuning
 
A arte do tuning
A arte do tuningA arte do tuning
A arte do tuning
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Java Profiling Tools

  • 1. Profilers Ferramentas de Monitoração Sunday, June 27, 2010
  • 3. Objetivo Compreender os principais conceitos de profiling de código e o funcionamento das ferramentas mais relevantes do mundo Java EE. 3 Sunday, June 27, 2010
  • 4. Profilers deveriam ser ferramentas de uso das equipes de desenvolvimento. 4 Sunday, June 27, 2010
  • 5. Profilers são ferramentas usadas pelas equipes de infra-estrutura para se protegerem de maus códigos. 5 Sunday, June 27, 2010
  • 6. HPROF Heap Profiler The Heap Profiler (HPROF) tool is a simple profiler agent shipped with the JDK release.(...)The HPROF tool is capable of presenting CPU usage, heap allocation statistics, and monitor contention profiles. In addition, it can report complete heap dumps and states of all the monitors and threads in the Java virtual machine. In terms of diagnosing problems, HPROF is useful when analyzing performance, lock contention, memory leaks, and other issues. http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tooldescr.html#gblvj 6 Sunday, June 27, 2010
  • 7. $ java -agentlib:hprof=help HPROF: Heap and CPU Profiling Agent (JVMTI Demonstration Code) hprof usage: java -agentlib:hprof=[help]|[<option>=<value>, ...] Option Name and Value Description Default --------------------- ----------- ------- heap=dump|sites|all heap profiling all cpu=samples|times|old CPU usage off monitor=y|n monitor contention n format=a|b text(txt) or binary output a file=<file> write data to file java.hprof[{.txt}] net=<host>:<port> send data over a socket off depth=<size> stack trace depth 4 interval=<ms> sample interval in ms 10 cutoff=<value> output cutoff point 0.0001 lineno=y|n line number in traces? y thread=y|n thread in traces? n doe=y|n dump on exit? y msa=y|n Solaris micro state accounting n force=y|n force output to <file> y verbose=y|n print messages about dumps y ... 7 Sunday, June 27, 2010
  • 8. Regra geral java -agentlib:hprof=... NomeDaClasse Ctrl+C Ctrl+ shutdown java.hprof.txt 8 Sunday, June 27, 2010
  • 9. $ JVM_ARGS="-agentlib:hprof=heap=sites" ./jmeter.sh THREAD START (obj=50000143, id = 200001, name="main", group="main") THREAD START (obj=500013d1, id = 200004, name="Java2D Disposer", group="system") THREAD START (obj=5000191f, id = 200005, name="AWT-XAWT", group="main") THREAD START (obj=5000195f, id = 200006, name="Image Fetcher 0", group="main") ... THREAD END (id = 200008) ... TRACE 300000: ! <empty> TRACE 300001: ! java.lang.Thread.<init>(Thread.java:432) TRACE 300002: ! java.lang.Thread.<init>(Thread.java:208) TRACE 300003: ! java.lang.String.toCharArray(String.java:2726) ! java.lang.Thread.init(Thread.java:349) ! java.lang.Thread.<init>(Thread.java:433) .... SITES BEGIN (ordered by live bytes) Wed May 27 07:34:16 2009 percent live alloc'ed stack class rank self accum bytes objs bytes objs trace name 1 9,88% 9,88% 2486200 3 2486200 3 317684 int[] 2 2,13% 12,01% 535440 6693 535760 6697 310354 javax.swing.text.html.InlineView 3 2,07% 14,08% 521592 159 623912 168 306967 char[] 4 1,78% 15,86% 447696 18654 450672 18778 305960 java.awt.Rectangle 5 1,72% 17,58% 432240 18010 599808 24992 310036 java.util.Hashtable$Entry java.hprof.txt 9 Sunday, June 27, 2010
  • 10. $ JVM_ARGS="-agentlib:hprof=heap=dump" ./jmeter.sh ... OBJ 50036a21 (sz=24, trace=309881, class=javax.swing.text.html.StyleSheet $SmallConversionSet@5000e518) ! attributes! 50036a22 ! this$0! ! 5000b0d6 ! this$0! ! 5000b0d6 ARR 50036a22 (sz=32, trace=309882, nelems=4, elem type=java.lang.Object[]@500000a0) ! [0]! ! 5000da97 ! [1]! ! 50065782 ! [2]! ! 50007706 ! [3]! ! 5000dae2 OBJ 50036a23 (sz=40, trace=310897, class=javax.swing.text.html.HTMLDocument$BlockElement@5000f3eb) ! parent! ! 50036901 ! attributes! 500107d4 ! this$0! ! 5000b16d ! children!50031212 ! this$0! ! 5000b16d ! this$0! ! 5000b16d OBJ 50036a24 (sz=392, trace=306854, class=javax.swing.JLabel@50000868) OBJ 50036a25 (sz=8, trace=306855, class=java.lang.Object@5000009f) OBJ 50036a26 (sz=8, trace=306856, class=java.lang.Object@5000009f) OBJ 50036a27 (sz=24, trace=300098, class=java.util.ArrayList@5000005b) ARR 50036a28 (sz=56, trace=305084, nelems=0, elem type=java.lang.Object[]@500000a0) OBJ 50036a29 (sz=16, trace=306857, class=javax.swing.event.EventListenerList@50002745) OBJ 50036a2a (sz=24, trace=306356, class=java.lang.ref.WeakReference@50000037) ... java.hprof.txt 10 9 Sunday, June 27, 2010
  • 11. $ JVM_ARGS="-agentlib:hprof=cpu=samples" ./jmeter.sh ... CPU SAMPLES BEGIN (total = 1564) Wed May 27 07:38:42 2009 rank self accum count trace method 1 48,47% 48,47% 758 300482 sun.awt.X11.XToolkit.waitForEvents 2 2,56% 51,02% 40 300104 java.lang.ClassLoader.defineClass1 3 1,15% 52,17% 18 300001 java.lang.ClassLoader.findBootstrapClass 4 1,09% 53,26% 17 301617 sun.awt.X11.XInputMethod.openXIMNative 5 0,77% 54,03% 12 300513 java.util.zip.Inflater.inflateBytes 6 0,77% 54,80% 12 300778 java.awt.EventQueue.postEventPrivate 7 0,77% 55,56% 12 300834 sun.font.FileFont.getGlyphImage 8 0,70% 56,27% 11 301388 java.lang.Class.forName0 ... java.hprof.txt 11 Sunday, June 27, 2010
  • 12. $ JVM_ARGS="-agentlib:hprof=cpu=samples" ./jmeter.sh ... CPU SAMPLES BEGIN (total = 1564) Wed May 27 07:38:42 2009 rank self accum count trace method 1 48,47% 48,47% 758 300482 sun.awt.X11.XToolkit.waitForEvents 2 2,56% 51,02% 40 300104 java.lang.ClassLoader.defineClass1 3 1,15% 52,17% 18 300001 java.lang.ClassLoader.findBootstrapClass 4 1,09% 53,26% 17 301617 sun.awt.X11.XInputMethod.openXIMNative 5 0,77% 54,03% 12 300513 java.util.zip.Inflater.inflateBytes 6 0,77% 54,80% 12 300778 java.awt.EventQueue.postEventPrivate 7 0,77% 55,56% 12 300834 sun.font.FileFont.getGlyphImage 8 0,70% 56,27% 11 301388 java.lang.Class.forName0 ... java.hprof.txt amostragem 11 Sunday, June 27, 2010
  • 13. $ JVM_ARGS="-agentlib:hprof=cpu=times" ./jmeter.sh ... CPU TIME (ms) BEGIN (total = 1743936) Wed May 27 07:44:33 2009 rank self accum count trace method 1 16,23% 16,23% 458 306106 java.lang.ref.ReferenceQueue.remove 2 16,21% 32,44% 40 306095 java.lang.Object.wait 3 16,18% 48,63% 52 317114 java.lang.ref.ReferenceQueue.remove 4 14,79% 63,42% 1 393892 java.util.TimerThread.mainLoop 5 7,67% 71,10% 1 391291 java.lang.Object.wait 6 2,97% 74,07% 37 312015 sun.awt.image.ImageFetcher.nextImage 7 0,74% 74,81% 50 320365 java.lang.Object.wait ... java.hprof.txt 12 Sunday, June 27, 2010
  • 14. $ JVM_ARGS="-agentlib:hprof=cpu=times" ./jmeter.sh ... CPU TIME (ms) BEGIN (total = 1743936) Wed May 27 07:44:33 2009 rank self accum count trace method 1 16,23% 16,23% 458 306106 java.lang.ref.ReferenceQueue.remove 2 16,21% 32,44% 40 306095 java.lang.Object.wait 3 16,18% 48,63% 52 317114 java.lang.ref.ReferenceQueue.remove 4 14,79% 63,42% 1 393892 java.util.TimerThread.mainLoop 5 7,67% 71,10% 1 391291 java.lang.Object.wait 6 2,97% 74,07% 37 312015 sun.awt.image.ImageFetcher.nextImage 7 0,74% 74,81% 50 320365 java.lang.Object.wait ... java.hprof.txt valores exatos 12 Sunday, June 27, 2010
  • 15. $ export JAVA_OPTS="-agentlib:hprof=monitor=y" $ ./catalina.sh run java.hprof.txt THREAD START (obj=5000013e, id = 200001, name="main", group="main") WAIT: MONITOR Ljava/lang/ref/Reference$Lock;, timeout=0, thread 200003 WAIT: MONITOR Ljava/lang/ref/ReferenceQueue$Lock;, timeout=0, thread 200004 WAITED: MONITOR Ljava/lang/ref/Reference$Lock;, time_waited=678, thread 200003 WAIT: MONITOR Ljava/lang/ref/Reference$Lock;, timeout=0, thread 200003 WAITED: MONITOR Ljava/lang/ref/ReferenceQueue$Lock;, time_waited=677, thread 200004 WAIT: MONITOR Ljava/lang/ref/ReferenceQueue$Lock;, timeout=0, thread 200004 WAITED: MONITOR Ljava/lang/ref/Reference$Lock;, time_waited=117, thread 200003 ... MONITOR DUMP BEGIN THREAD 200001, trace 300804, status: native|R THREAD 200002, trace 300000, status: ZO THREAD 200003, trace 300210, status: CW THREAD 200004, trace 300212, status: CW THREAD 200006, trace 300805, status: SL THREAD 200007, trace 300000, status: ZO ... MONITOR Ljava/net/SocksSocketImpl; ! owner: thread 200001, entry count: 1 ! waiting to enter: ! waiting to be notified: MONITOR Ljava/lang/Shutdown$Lock; ! owner: thread 200013, entry count: 1 ! waiting to enter: ! waiting to be notified: MONITOR Ljava/lang/Class; ! owner: thread 200013, entry count: 1 ! waiting to enter: ! waiting to be notified: MONITOR DUMP END 13 Sunday, June 27, 2010
  • 16. jboss-4.2.2.GA/bin $ tail -3 run.conf # Ativacao do HPROF JAVA_OPTS="$JAVA_OPTS -agentlib:hprof=cpu=samples,file=jboss.hprof.txt" jboss-4.2.2.GA/bin $ ./run.sh ========================================================================= JBoss Bootstrap Environment Parâmetro configurado no JBOSS_HOME: /Users/alegomes/jbtun/app/jboss-4.2.2.GA JBoss... JAVA: /Library/Java/Home/bin/java JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 - Dsun.rmi.dgc.server.gcInterval=3600000 -Dcom.sun.management.jmxremote - Djboss.platform.mbeanserver - Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl - agentlib:hprof=cpu=samples,file=jboss.hprof.txt CLASSPATH: /Users/alegomes/jbtun/app/jboss-4.2.2.GA/bin/run.jar ========================================================================= 08:36:39,356 INFO [Server] Starting JBoss (MX MicroKernel)... 08:36:39,368 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139) ... 08:38:53,308 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009 08:38:53,402 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)] Started in 2m:13s:890ms ...mas nada demais aconteceu. 14 Sunday, June 27, 2010
  • 17. Ctrl + jboss.hprof.txt 15 Sunday, June 27, 2010
  • 18. java.hprof.txt JAVA PROFILE 1.0.1, created Wed May 27 07:33:19 2009 Header for -agentlib:hprof (or -Xrunhprof) ASCII Output (JDK 5.0 JVMTI based) @(#)jvm.hprof.txt! 1.5 06/01/28 Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. WARNING! This file format is under development, and is subject to change without notice. This file contains the following types of records: ... documentação no próprio arquivo gerado 16 Sunday, June 27, 2010
  • 19. THREAD START THREAD END mark the lifetime of Java threads THREAD START (obj=5000013f, id = 200001, name="main", group="main") THREAD START (obj=5000013f, id = 200005, name="Java2D Disposer", group="system") THREAD START (obj=5000013f, id = 200006, name="AWT-XAWT", group="main") THREAD START (obj=5000013f, id = 200007, name="Image Fetcher 0", group="main") THREAD START (obj=5000013f, id = 200008, name="Image Fetcher 1", group="main") THREAD START (obj=5000013f, id = 200009, name="Image Fetcher 2", group="main") THREAD START (obj=5000013f, id = 200010, name="AWT-Shutdown", group="main") THREAD START (obj=500005e7, id = 200011, name="AWT-EventQueue-0", group="main") THREAD END (id = 200008) THREAD END (id = 200007) THREAD END (id = 200009) THREAD END (id = 200010) THREAD END (id = 200011) 17 Sunday, June 27, 2010
  • 20. TRACE represents a Java stack trace. Each trace consists of a series of stack frames. Other records refer to TRACEs to identify (1) where object allocations have taken place, (2) the frames in which GC roots were found, and (3) frequently executed methods. TRACE 306106: ! java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line) ! java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line) ! java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:Unknown line) TRACE 306095: ! java.lang.Object.wait(Object.java:Unknown line) ! java.lang.ref.Reference$ReferenceHandler.run(Reference.java:Unknown line) TRACE 317114: ! java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line) ! java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line) ! sun.java2d.Disposer.run(Disposer.java:Unknown line) ! java.lang.Thread.run(Thread.java:Unknown line) 18 Sunday, June 27, 2010
  • 21. HEAP DUMP is a complete snapshot of all live objects in the Java heap. Following distinctions are made: ROOT root set as determined by GC CLS classes OBJ instances ARR arrays OBJ 50036a24 (sz=392, trace=306854, class=javax.swing.JLabel@50000868) OBJ 50036a25 (sz=8, trace=306855, class=java.lang.Object@5000009f) OBJ 50036a26 (sz=8, trace=306856, class=java.lang.Object@5000009f) OBJ 50036a27 (sz=24, trace=300098, class=java.util.ArrayList@5000005b) ARR 50036a28 (sz=56, trace=305084, nelems=0, elem type=java.lang.Object[]@500000a0) OBJ 50036a29 (sz=16, trace=306857, class=javax.swing.event.EventListenerList@50002745) OBJ 50036a2a (sz=24, trace=306356, class=java.lang.ref.WeakReference@50000037) 19 Sunday, June 27, 2010
  • 22. SITES is a sorted list of allocation sites. This identifies the most heavily allocated object types, and the TRACE at which those allocations occurred. SITES BEGIN (ordered by live bytes) Wed May 27 07:34:16 2009 percent live alloc'ed stack class rank self accum bytes objs bytes objs trace name 1 9,88% 9,88% 2486200 3 2486200 3 317684 int[] 2 2,13% 12,01% 535440 6693 535760 6697 310354 javax.swing.text.html.InlineView 3 2,07% 14,08% 521592 159 623912 168 306967 char[] 4 1,78% 15,86% 447696 18654 450672 18778 305960 java.awt.Rectangle 5 1,72% 17,58% 432240 18010 599808 24992 310036 java.util.Hashtable$Entry 6 1,69% 19,27% 426240 3330 426368 3331 309154 javax.swing.text.html.ParagraphView 20 Sunday, June 27, 2010
  • 23. NetBeans Profiler “ The NetBeans profiler provides expert assistance for optimizing your application's speed and memory usage, and makes it easier to build reliable and scalable Java SE, JavaFX and Java EE applications. http://www.netbeans.org/features/java/profiler.html 21 Sunday, June 27, 2010
  • 24. WebApp Inicializa a aplicação web em modo de profiling 22 Sunday, June 27, 2010
  • 25. Qual método gastou mais tempo de processamento durante a bateria de testes? 23 Sunday, June 27, 2010
  • 26. Memória vs Garbage Collector 24 Sunday, June 27, 2010
  • 27. Memória disponível x Memória em uso 25 Sunday, June 27, 2010
  • 28. Threads alocadas x Classes carregadas 26 Sunday, June 27, 2010
  • 29. Quais objetos ocuparam mais memória? 27 Sunday, June 27, 2010
  • 30. Threads alocadas 28 Sunday, June 27, 2010
  • 31. Acabou a memória disponível. 29 Sunday, June 27, 2010
  • 32. Mesmo erro no log do Tomcat do NetBeans 30 Sunday, June 27, 2010
  • 33. The Eclipse Test & Performance Tools Platform (TPTP) The Eclipse Test and Performance Tools Platform (TPTP) Project provides an open platform supplying powerful frameworks and services that allow software developers to build unique test and performance tools, both open source and commercial, that can be easily integrated with the platform and with other tools. http://www.eclipse.org/tptp/ 31 Sunday, June 27, 2010
  • 35. instalação do plugin via software update 33 Sunday, June 27, 2010
  • 36. atenção ao servidor TPTP 34 Sunday, June 27, 2010
  • 37. pacotes que serão instalados 35 Sunday, June 27, 2010
  • 38. última checagem... 36 Sunday, June 27, 2010
  • 40. ... 38 Sunday, June 27, 2010
  • 42. http://www.eclipse.org/tptp/ home/downloads/4.5.0/ documents/quicktour/ WTP_viewlet20061206/ WTP_viewlet20061206.swf 40 Sunday, June 27, 2010
  • 43. Usando HPROF, NetBeans ou Eclipse, realizar o profiling da alguma aplicação web Java durante uma sessão de testes de carga. 41 Sunday, June 27, 2010
  • 44. JProfiler “ JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. http://www.ej-technologies.com/products/jprofiler/overview.html 42 Sunday, June 27, 2010
  • 45. 1 desenvolvedor N desenvolvedores 43 Sunday, June 27, 2010
  • 46. Tempo de execução de cada método 44 Sunday, June 27, 2010
  • 47. Tempo de execução de cada método 44 Sunday, June 27, 2010
  • 48. Número de instâncias de cada classe 45 Sunday, June 27, 2010
  • 49. Número de instâncias de cada classe 45 Sunday, June 27, 2010
  • 50. Grafo de referências entre objetos 46 Sunday, June 27, 2010
  • 51. Grafo de referências entre objetos 46 Sunday, June 27, 2010
  • 52. Invocação entre métodos 47 Sunday, June 27, 2010
  • 53. Invocação entre métodos 47 Sunday, June 27, 2010
  • 54. Memória consumida por cada método 48 Sunday, June 27, 2010
  • 55. Memória consumida por cada método 48 Sunday, June 27, 2010
  • 56. Threads do servidor 49 Sunday, June 27, 2010
  • 57. Threads do servidor 49 Sunday, June 27, 2010
  • 58. Quais threads estão sendo bloqueadas e por quê. 50 Sunday, June 27, 2010
  • 59. Quais threads estão sendo bloqueadas e por quê. 50 Sunday, June 27, 2010
  • 62. JBoss Profiler “ JBoss Profiler is a log based profiler using JVMPI and JVMTI. It uses an agent written in C that captures events from the JVM and logs to disk. A web application running on JBoss or another machine can be used to analyze these logs through a web browser. http://www.jboss.org/jbossprofiler/ 52 Sunday, June 27, 2010
  • 63. JBoss Profiler instalação unzip jboss-profiler-2.0.Beta3.SP1.zip 53 Sunday, June 27, 2010
  • 64. JBoss Profiler instalação • Copiar para JBOSS_HOME/bin • jboss-profiler.jar, • jboss-profiler.properties, • jboss-profiler-plugins.jar • Copiar para JBOSS_HOME/server/<conf>/deploy • jboss-profiler.sar • Se JBoss 4.2x, copie para JBOSS_HOME/bin: • javassist.jar 54 Sunday, June 27, 2010
  • 65. JBoss Profiler instalação • Em JBOSS_HOME/bin/jboss-profiler.properties # Pacote a ser monitorado pelo Profiler includes=br.com.seatecnologia.jbosstuning.* • Em JBOSS_HOME/bin/run.conf # Ativacao do JBoss Profiler JAVA_OPTS="$JAVA_OPTS -javaagent:jboss-profiler.jar -Djboss-profiler.properties=jboss-profiler.properties" 55 Sunday, June 27, 2010
  • 66. JBoss Profiler instalação Reinicialize o JBoss Ctrl+C 56 Sunday, June 27, 2010
  • 67. JBoss Profiler utilização • Inicie o JBoss Profiler java -jar jboss-profiler-client.jar startProfiler • Execute a aplicação Hora de executar o plano de teste do JMeter • Pare o JBoss Profiler java -jar jboss-profiler-client.jar stopProfiler • Colete os dados para análise java -jar jboss-profiler-client.jar getSnapshot 1 57 Sunday, June 27, 2010
  • 68. java -jar jboss-profiler-client.jar getSnapshot 1 Diretório criado Arquivos com os resultados do profiling Diretório de instalação do jboss-profiler 58 Sunday, June 27, 2010
  • 69. Duração do teste Thread mais demorada Métodos mais demorados Métodos que mais usaram a CPU 59 Sunday, June 27, 2010
  • 70. Nova interface Web do JBossProfiler2 60 Sunday, June 27, 2010
  • 71. MBeans do JBoss Profiler (jboss-profiler.sar) 61 Sunday, June 27, 2010
  • 72. Operações do JBoss Profiler via MBean 62 Sunday, June 27, 2010
  • 73. Twiddle: -------- Information: ./twiddle.sh get 'org.jboss.profiler:service=Profiler' Running ./twiddle.sh get 'org.jboss.profiler:service=Profiler' Enabled ./twiddle.sh get 'org.jboss.profiler:service=Profiler' Memory ./twiddle.sh get 'org.jboss.profiler:service=Profiler' File ./twiddle.sh get 'org.jboss.profiler:service=Profiler' EJB ./twiddle.sh get 'org.jboss.profiler:service=Profiler' Servlet ./twiddle.sh get 'org.jboss.profiler:service=Profiler' JSF ./twiddle.sh get 'org.jboss.profiler:service=Profiler' JMX ./twiddle.sh get 'org.jboss.profiler:service=Profiler' RMI ./twiddle.sh get 'org.jboss.profiler:service=Profiler' CORBA Operations: ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' startProfiler ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' stopProfiler ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' enableProfiler ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' disableProfiler ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' clearSnapshots ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' addClasses org.jboss.test.* public ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' removeClasses org.jboss.test.* ./twiddle.sh invoke 'org.jboss.profiler:service=Profiler' listClasses 63 Sunday, June 27, 2010
  • 74. YourKit “ With YourKit solutions, both CPU and memory profiling have come to the highest professional level, where one can profile even huge applications with maximum productivity and zero overhead. http://www.yourkit.com/ 64 Sunday, June 27, 2010
  • 77. Informe a licença que foi enviada por email. 67 Sunday, June 27, 2010
  • 78. Tela de configuração 68 Sunday, June 27, 2010
  • 79. Nenhum aplicativo para profiling Conectar a JEE Server Local 69 Sunday, June 27, 2010
  • 80. Escolha o servidor a ser monitorado 70 Sunday, June 27, 2010
  • 81. Configurações específicas do servidor escolhido 71 Sunday, June 27, 2010
  • 82. Script de inicialização do servidor gerado pelo YourKit 72 Sunday, June 27, 2010
  • 83. JBoss automaticamente identificado http://www.yourkit.com/docs/80/help/ 73 Sunday, June 27, 2010
  • 84. Primeira tela do profiler 74 Sunday, June 27, 2010
  • 85. Após iniciar o profiling de CPU... ...estatísticas de execução são apresentadas. 75 Sunday, June 27, 2010
  • 86. Ao final dos testes, salve os dados coletados para análise mais detalhada. 76 Sunday, June 27, 2010
  • 88. Métodos invocados por cada thread 78 Sunday, June 27, 2010
  • 89. Métodos que mais consumiram CPU 79 Sunday, June 27, 2010
  • 90. Lista de todos os métodos executados durante os testes 80 Sunday, June 27, 2010
  • 91. Análise de JSPs e Servlets 81 Sunday, June 27, 2010
  • 92. Uso da memória 82 Sunday, June 27, 2010
  • 93. Como o GC se comportou. 83 Sunday, June 27, 2010
  • 94. Habilitar telemetria de threads 84 Sunday, June 27, 2010
  • 95. Threads do conector HTTP 85 Sunday, June 27, 2010
  • 96. Captura dados da memória para análise fina. 86 Sunday, June 27, 2010
  • 97. Abra o snapshot criado 87 Sunday, June 27, 2010
  • 99. Dicas para otimização da memória 89 Sunday, June 27, 2010
  • 100. Em todas as telas há links diretos para a documentação da ferramenta 90 Sunday, June 27, 2010
  • 101. Já sabem o que fazer, né? ;-) 91 Sunday, June 27, 2010