Java SE Performance TuningRevision ASEM-DTJ-380-LA
Copyright 2008 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may bereproduced in any form by any means without prior written authorization of Sun and its licensors, if any.Third-party software, including font technology, is copyrighted and licensed from Sun suppliers.Sun, Sun Microsystems, the Sun logo, the Duke logo, Java, JavaServer Pages, JSP, Java HotSpot, Java VisualVM, Sun Fire T1000, Sun Fire T2000, UltraSparc, NetBeans, NetBeansProfiler, Sun Studio, and JavaScript are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox inresearching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical UserInterface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license agreements.Federal Acquisitions: Commercial Software Government Users Subject to Standard License Terms and ConditionsExport Laws. Products, Services, and technical data delivered by Sun may be subject to U.S. export controls or the trade laws of other countries. You will comply with all such laws andobtain all licenses to export, re-export, or import as may be required after delivery to You. You will not export or re-export to entities on the most current U.S. export exclusions lists or toany country subject to U.S. embargo or terrorist controls as specified in the U.S. export laws. You will not use or provide Products, Services, or technical data for nuclear, missile, orchemical biological weaponry end uses.DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS, AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELDTO BE LEGALLY INVALID.Export Control Classification Number (ECCN) assigned:EAR99
Copyright 2008 Sun Microsystems Inc., 4150 Network Circle, Santa Clara, California 95054, Etats-Unis. Tous droits ré servé s.Ce produit ou document est proté gé par un copyright et distribué avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la dé compilation. Aucune partie de ce produitou document ne peut ê tre reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation pré alable et é crite de Sun et de ses bailleurs de licence, s'il y en a.Le logiciel dé tenu par des tiers, et qui comprend la technologie relative aux polices de caractè res, est proté gé par un copyright et licencié par des fournisseurs de Sun.Sun, Sun Microsystems, the Sun logo, the Duke logo, Java, JavaServer Pages, JSP, Java HotSpot, Java VisualVM, Sun Fire T1000, Sun Fire T2000, UltraSparc, NetBeans, NetBeansProfiler, Sun Studio et JavaScript sont des marques de fabrique ou des marques dé posé es de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays.L'interfaces d'utilisation graphique OPEN LOOK et Sun a é té dé veloppé e par Sun Microsystems, Inc. pour ses utilisateurs et licencié s. Sun reconnaît les efforts de pionniers de Xerox pourlarecherche et le dé veloppement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun dé tient une licence non exclusive de Xerox surl'interface d'utilisation graphique Xerox, cette licence couvrant é galement les licencié s de Sun qui mettent en place l'interface d'utilisation graphique OPEN LOOK et qui en outre seconforment aux licences é crites de Sun.Lé gislation en matiè re dexportations. Les Produits, Services et donné es techniques livré s par Sun peuvent ê tre soumis aux contrô les amé ricains sur les exportations, ou à la lé gislationcommerciale dautres pays. Nous nous conformerons à lensemble de ces textes et nous obtiendrons toutes licences dexportation, de ré -exportation ou dimportation susceptibles dê trerequises aprè s livraison à Vous. Vous nexporterez, ni ne ré -exporterez en aucun cas à des entité s figurant sur les listes amé ricaines dinterdiction dexportation les plus courantes, ni versun quelconque pays soumis à embargo par les Etats-Unis, ou à des contrô les anti-terroristes, comme pré vu par la lé gislation amé ricaine en matiè re dexportations. Vous nutiliserez, ni nefournirez les Produits, Services ou donné es techniques pour aucune utilisation finale lié e aux armes nuclé aires, chimiques ou biologiques ou aux missiles.LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENTEXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, AL'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFAÇ ON.
Course Objectives Incorporate monitoring, profiling and tuning into the appMonitor the Operating System (OS) layer: Central ProceMonitor the Java Virtual Machine (JVM) and applicationProfile the OS, JVM and application layersTune garbage collection (GC)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A4
Course Objectives Examine and manage the Just in Time (JIT)compiler Examine JVM ergonomics Examine 64 bit JVMs Tune the JVM for multi-core platformsThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A5
Course Overview: What to Expect Master Java SE performance monitoring by learning: What and where to performance monitorWhat to profile and what tools work the best for different use casesCommonly observed patterns indicating performance issuesHow Java HotSpot garbage collectors work and how to tune themWhat you need to know about the JIT compilerWhat is JVM ergonomics and how it worksWhat you need to know about 64-bit JVMsHow to tune the JVM for specific hardware platformsThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A6
Course Overview: What to Expect In short, learn the basics of the JVM internals andThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A7
Course Overview: The Nature of Perform Performance tuning is largely an art. There is no one approach that is always necessarily the There are performance issues which will require very spThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A8
Course Module OutlinesModule 1: Examining Performance Tuning Distinguishing between monitoring, profiling and tunin Incorporating monitoring, profiling and tuning into the Module 2: Monitoring the OS Layer Monitoring CPU utilization Monitoring network performance Monitoring disk input output (I/O) Monitoring memory utilization Monitoring process behavior The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A9
Course Module Outlines Module 3: Monitoring the JVM and Application Layers Examining generational collector architectures Monitoring GC Monitoring the JVM Monitoring the application Module 4: Profiling the OS, JVM and Application Layers Examining profiling tools Profiling CPU usage Profiling the heap and memory usage Detecting lock contentionThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A10
Course Module Outlines Module 5: Tuning GC Tuning collector generation sizes Selecting the collector that best fits application characteristics Examining practices that negatively impact GC performance Module 6: Examining and Managing the JIT compiler Examining choices of JIT compilers Tuning the JIT compiler Creating micro benchmarksThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A11
Course Module Outlines Module 7: Examining Ergonomics Examining JVM ergonomics behavior Module 8: Using 64 bit JVMs Examine the issues associated with using 64 bit JVMs Identify application characteristics that suit 64 bit JVMs Tuning 64 bit JVM for different application requirements Module 9: Optimize the JVM for Multi-core platforms Examining JVM features that can leverage multi-core archite Optimize the JVM for various multi-core architectures Tuning the JVM for the Sun Fire T1000/T2000 platformThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A12
Module 1: Examining PerformaSEM-DTJ-380-LA
Objectives Distinguish between monitoring, profiling and tuning Incorporate monitoring, profiling and tuning into the appThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A14
Definitions Performance monitoring Performance profiling Performance tuningThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A15
Definitions: Performance Monitoring An act of non-intrusively collecting or observing performIn most cases, a “preventative” or “proactive” type of acCan be performed in production, or qualification, or devHelps identify or isolate potential issues without havingThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A16
Definitions: Performance Monitoring Often times monitoring crosses over into trouble-shootin Training focus is on performance monitoring aspects ra Training is focused more on techniques and tools relateThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A17
Definitions: Performance Profiling An act of collecting or observing performance data from Usually more intrusive than monitoring. Usually a narrower focus than monitoring. In general a reactive type of activity. Could be a proactiv Seldom performed in production environments. Commonly done in qualification, testing or developmentThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A18
Definitions: Performance Tuning An act of changing tune-ables, source code and/or conf Usually results from monitoring and/or profiling activitiesThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A19
Typical Development e Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A20
Application Performance OKYesDeployThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A21NoProfile
Application Performance OKMonitorThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision AYesDeploy22NoProfile
Module 2: Monitoring the OThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A23
Objectives Monitor CPU usage Monitor network I/O Monitor disk I/O Monitor virtual memory usage Monitor processes including lock contentionThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A24
What to Expect What level of the software stack to monitor Operating system level JVM level (covered in module 3) Application level (covered in module 3) What information to monitor What to monitor is covered per component at a given Example: At OS level, monitor CPU usage What tools to useThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A25
What to Monitor in the OS Level CPU utilization Network traffic Disk I/O Virtual memory usage Processes and kernel locksMonitoring definition recap: An act of non-intrusively colleThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A26
Monitoring CPU Usage: Overview Rationale for monitoring CPU usage Get big picture view of CPU demand Get per process measurement of CPU utilization Measurements of CPU usage User (usr) time System (sys) time Idle time Voluntary context switching (VCX) Involuntary context switching (ICX) Tools for monitoring CPU usageThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A27
CPU monitoring: What to look for High sys / kernel cpu time High sys / kernel cpu time indicates a lot of cpucycles are spent in the kernel. A reduction in kernel cpu time will give morecpu time to the application. Also, high sys cpu time could indicate sharedresource contention, (in other words, locking).More on lock contention later.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A28
CPU monitoring: What to look for Idle cpu On multi-threaded applications and multi-coresystems, idle cpu can be an indicator of anapplication's inability to scale. Combination of high sys or kernel CPUutilization and idle CPU could indicate sharedresource contention as the scalability blocker. Applicable to all operating systems, i.e.Windows, Linux and SolarisThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A29
Voluntary Context Switching (VCX)ThreadThreadThreadblockblockThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A30
Involuntary Context Switching (VCX)ThreadLowPriorityThreadThreadCPU ContextSwitchThreadPriorityInterruptThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A31
CPU monitoring: What to look for High VCX High voluntary context switching can be anindication an application is experiencing lockcontention as a result of the JVM implements orsupports Java locking such as synchronizedmethods or block, or Read/Write locks in thejava.util.concurrent.locks package. High ICX There are some applications (most often seen in OLTP /database systems) which can benefit by switching to theSolaris FX (fixed) scheduler as a means to reducecontext switching. For Solaris, use priocntl to set FX scheduling:32 priocntl c FX -s PID [ PID . ] for disc next weekThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A
Tools For Monitoring: CPU Usage Tools to monitor cpu utilization vmstat (Solaris & Linux) mpstat (Solaris) prstat (Solaris) top (Linux, prefer prstat on Solaris) Task Manager (Windows) Performance Monitor (Windows) Windows Resource Manager (Windows Server) xosview (Linux) cpubar (Solaris – Performance Tools CD) iobar (Solaris – Performance Tools CD) dtrace (Solaris)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A33
Tools for Monitoring CPU Usage: vmstat Use vmstat to obtain summaries of CPU usage Data of interest: us – user time; sy – system time; id – idle timeThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A34
CPU Usage Monitoring: vmstat us – user time; sy – system time; id – idle timeThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A35
Tools For Monitoring: mpstat usr – user time; sys – system time; idl – idle timecsw – context switches; icsw – involuntary context switchesThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A36
Tools For Monitoring: prstat Example of overall CPU time measured per processThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A37
CPU monitoring: prstat -m Example of CPU utilization microstate information measured perprocess Data of interest: USR, SYS, VCX, ICXThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A38
Tools For Monitoring: prstat -Lm Example of CPU utilization including microstate informationmeasured per light weight process. (USR, SYS, VCX, ICX)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A39
CPU Monitoring: Solaris - cpubar Data of interest: 0 – CPU 0; 1 – CPU 1 avg – Average;--- Moving average; Green – User; Red – System; Blue – Idle Available on Solaris Performance Tools 3.0 CD, or download r/PerformanceCD3.0.tar.gzThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A40
CPU monitoring: How to map Java Threadsto Light Weight Processes (LWPs) Use HotSpot's jps command to find the process ids ofall running Java processes on your machine. Use Solaris prstat -Lm, or prstat -Lmp pid to locatethe LWP id(s) consuming the most cpu (usr or sys). Use HotSpot's jstack to find the executing threadstaking the cpu (usr and sys) time. Map the LWPID to jstack's thread id. LWPID is in the far right column of prstat. Look for jstack's corresponding 'nid', reported inhex.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A41
Module 2: Demo 1The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A4242
CPU monitoring: Linux - vmstat Use vmstat to obtain summaries of CPU usage Data of interest: us – user time; sy – system time; id – idle timeThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A43
CPU Monitoring: Linux mpstatThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A44
CPU Monitoring Using: pidstat %user - % of user level(application) task %system - % of system level(kernel) task %CPU – total % of CPU time cswch/s – total voluntarycontext switches/second nvcswhc/s – total involuntarycontext switches/secondThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A45
CPU monitoring : Linux - xosview Data of interest: CPU 0 and CPU 1The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A46
Monitoring Network I/O: Overview Data of interest Network utilization in terms of TransactionControl Protocol (TCP) statistics andestablished connections Tools to monitor network I/O netstat (Solaris & Linux) Performance Monitor (Windows) dtrace (Solaris) nicstat (Solaris – Performance Tools CD) tcptop (Dtrace Toolkit)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A47
Monitoring Network I/O: Using tcptop tcptop can show per process TCP statistics The screen capture shows 'rcp' generating 115 kbof trafficThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A48
Monitoring Network I/O: Using nicstat nicstat displays network statistics Notice wAvs, write average size, during four intervals is about1420 bytes, the Maximum Transmission Unit (MTU) size.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A49
Monitoring Disk I/O: Overview Data of interest Number of disk accesses Latency and average latencies Tools to monitor disk I/O iostat (Solaris & Linux) iotop (Solaris & Linux) pidstat (Linux) Performance Monitor (Windows) dtrace (Solaris) iobar (Solaris – Performance Tools CD) Disk cachesThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A50
Disk I/O Monitoring Tools: iostat, iobar,iotop, pidstat iostat reports per disk, text outputiobar reports per disk, gui outputiotop reports per process statistics, text outputpidstat reports per process statistics, text outputData of interest number of disk accesses, latency, averagelatenciesThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A51
Monitoring Disk I/O: iotop example iotop reporting at a 5 second interval DISKTIME reported in microseconds CMD find, is keeping disk cmdk0 busy almost60% of time during the 5 second intervalThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A52
Monitoring Disk I/O: pidstat exampleThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A53
Monitoring Disk IO: Disk Cache Why not enable disk cache? What's the risk? On some Sun branded systems, disk cache may bedisabled by default. Linux & Windows systems usuallyhave it enabled. Disk cache being disabled depends on the Sun brandedmodel and how recent the model. Ask before disabling.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A54
Monitoring Virtual Memory: Overview Observe paging to identify swapping Pages in (pi) Pages out (po) Scan rate (sr) Fixing the swapping problemThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A55
Monitoring Virtual Memory: Swapping Why is swapping bad for a Java application? Any volunteer want to explain?The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A56
Monitoring Virtual Memory: Tools Tools to monitor memory paging & usage vmstat (Solaris & Linux) prstat (Solaris) top (Linux – prefer prstat on Solaris) Performance Monitor (Windows) dtrace (Solaris) cpubar (Solaris – Performance Tools CD) meminfo (Solaris – Performance Tools CD)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A57
Monitoring Virtual Memory: vmstat Data of interest: pi – pages in; po – pages out;sr – page scan rateThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A58
Virtual Memory: Swapping Example Data of interest pi – pages in; po – pages out; sr – page scan rate Watch for high scan rate (see rows 3 to 6), orincreasing trend. Low scan rate is ok if they occurinfrequently.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A59
Monitoring Virtual Memory : cpubar Data of interest p/s - pages per second, sr - scan rate Watch for high scan rate, or increasing trend.Low scan rate is ok if they occur infrequently.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A60
Virtual Memory: Fixing theSwapping Problem Smaller Java heap sizes Add physical memory Reduce number of applications running on themachine Any one, or any combination of the above will helpThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A61
Monitoring Processes: Overview Data of interest Footprint size Number of threads and thread state CPU usage Runtime stack Context switches Lock contentionThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A62
Monitoring Processes: Questions ofInterest Why is footprint size, number of threads, threadstate, lock contention and context switchingimportant to monitor? What does lock contention and/or contextswitching look like on Solaris? How can you find the lock or locks causingproblems? How can you address the thread context switchingproblem?The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A63
Monitoring Processes: Tools ps (Solaris & Linux)vmstat (Solaris & Linux)mpstat (Solaris)prstat (Solaris)pidstat (Linux)Performance Monitor (Windows)top (Linux – prefer prstat on Solaris)dtrace (Solaris)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A64
Monitoring Processes: prstat -LmData of interest: Number of threads per process (sum of LWPIDs per PID);CPU usage (USR, SYS); Locks (LCK); Context switches (VCX and ICX);The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A65
Monitoring Processes: mpstat Data of interest: csw – context switches; icsw – involuntarycontext switches; smtx – lock contentionThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A66
Monitoring Processes: Kernel Data of interest kernel cpu utilization, locks, system calls,interrupts, migrations, run queue depth Tools to monitor the kernel vmstat (Linux & Solaris) mpstat (Solaris) lockstat & plockstat (Solaris) Performance Monitor (Windows) dtrace (Solaris) intrstat (Solaris)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A67
Kernel Monitoring: What to look for Why are high sys / kernel cpu, run queue depth,lock contention, migrations and context switchingimportant to monitor? Discussion What do they indicate when each is observed? Discussion How to do you address each of these problems? DiscussionThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A68
Kernel Monitoring Using: vmstat Data of interest: Kernel cpu utilization, run queue depth(r column – represents number of runnable kernel threads)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A69
Kernel Monitoring Using: mpstat Data of interest: Kernel cpu utilization(sys); locks(smtx);system calls(syscl); interrupts(intr); migrations(migr); contextswitches (csw); involuntary context switches (iscw)The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A70
Kernel Monitoring Using : prstat -Lm Data of interest: Kernel cpu utilization(SYS), locks(LCK),system calls(SCL), voluntary context switches(vCX);involuntary context switches (icx).The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A71
Kernel Monitoring Using: pidstat %user - % of user level(application) task %system - % of system level(kernel) task %CPU – total % of CPU time cswch/s – total voluntarycontext switches/second nvcswhc/s – total involuntarycontext switches/secondThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A72
Module 3: Monitoring the JVM aSEM-DTJ-380-LA
Objectives Examine HotSpot generational garbage collectors Monitor the JVM GC JIT compiler Monitor the application Application throughput Application responsivenessThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A74
What to Expect Overview of generational GC How to monitoring the JVM GC: Which tools to use and what to monitor JIT compiler: Which tools to use and what tomonitor How to monitoring the application Application throughput Application responsivenessThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A75
What to Monitor: JVM There are two major areas to monitor at the JVMlevel of the software stack. Garbage collector The portion of the JVM responsible forfreeing memory no longer utilized byapplication logic. The “magic” that letsprogrammers not have to worry about“managing memory”. Garbage collection involves traversing Java heap spaces where application objects are allocatedand managed by the JVM's garbage collector. JIT compilationThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A76 The portion of the JVM responsible for
Monitoring GC Examining the GC Basics Young generation Tenured generation Permanent generation Data of interest Frequency and duration of collections Java heap usage Number of application threadsThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A77
GC Basics HotSpot uses what is termed “generationalcollectors” HotSpot Java heap is allocated into generationalspaces.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A78
GC Basics: The Major Spaces Young generation Further divided into: Eden A “from” survivor space A “to” survivor space Java objects are allocated in eden Tenured (old) generation Permanent generationThe Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A79
GC Basics: Young Generation When eden space is full, minor garbage collectionevent occurs. Live objects in eden space arecopied “to” a survivor space. Additionally, objects in the “from” survivor spaceare copied “to” survivor space. Each object which survives a garbage collectionhas its age incremented. Objects exceeding a JVM defined age thresholdare promoted to the tenured (old) generationspace.The Java SE Performance TuningCopyright 2008 Sun Microsystems, Inc. All Rights Reserved. Revision A80
GC Basics: Young Generation If “to” survivor space is too small to hold survivingEden and “from” survivor space objects, objectswill be promoted to “tenured” space. This is a situation which can potentially lead toperformance issues. Short lived objects getti
Sun, Sun Microsystems, the Sun logo, the Duke logo, Java, JavaServer Pages, JSP, Java HotSpot, Java VisualVM, Sun Fire T1000, Sun Fire T2000, UltraSparc, NetBeans, NetBeans Profiler, Sun Studio et JavaScript sont des marques de fabrique ou des marques dé posé es de Sun
Java Version Java FAQs 2. Java Version 2.1 Used Java Version This is how you find your Java version: Start the Control Panel Java General About. 2.2 Checking Java Version Check Java version on https://www.java.com/de/download/installed.jsp. 2.3 Switching on Java Console Start Control Panel Java Advanced. The following window appears:
OS Performance - Filesystem Tuning - Filesystems - Other Filesystems Performance Tuning Exercise 2 OS Performance - General - Virtual Memory - Drive tuning - Network Tuning Core Settings TCP/IP Settings - CPU related tuning - 2.4 Kernel tunables - 2.6 Kernel tunables Performance Tuning Exercise 3 Performance Monitoring
To be effective, performance tuning needs to be comprehensive, iterative and address several levels: Configuration of the BPM software, The design of your application, Tuning of the application server, Tuning of the Java Virtual Machine, Tuning of the database, Tuning of operating system and kernel parameters,
3. _ is a software that interprets Java bytecode. a. Java virtual machine b. Java compiler c. Java debugger d. Java API 4. Which of the following is true? a. Java uses only interpreter b. Java uses only compiler. c. Java uses both interpreter and compiler. d. None of the above. 5. A Java file with
–‘java’ command launches Java runtime with Java bytecode An interpreter executes a program by processing each Java bytecode A just-in-time compiler generates native instructions for a target machine from Java bytecode of a hotspot method 9 Easy and High Performance GPU Programming for Java Programmers Java program (.
IBM FileNet P8 5.0 Performance Tuning Guide . About this document ― Tuning tip organization . About this document . This document provides tuning tips that can help you improve the performance of IBM FileNet P8. Tuning tip organization . If a tuning tip involves an independent software vendor product, and it applies to more than one of the
Many productive parallel/distributed programming libs: Java shared memory programming (high level facilities: Concurrency framework) Java Sockets Java RMI Message-Passing in Java (MPJ) libraries Apache Hadoop Guillermo López Taboada High Performance Computing in Java and the Cloud . Guillermo López Taboada High Performance Computing in Java .
besteht aus der Java-API (Java Application Programming Interface) und der Java-VM (Java Virtual Machine). Abbildung 1: Java-Plattform Die Java-API ist eine große Sammlung von Java-Programmen, die in sog. Pakete (packages) aufgeteilt sind. Pakete sind vergleichbar mit Bibliotheken in anderen Programmiersprachen und umfassen u.a.