SlideShare a Scribd company logo
Java Middleware Surgery
Andy Overton &
Mike Croft
Expert Support Team
© C2B2 Consulting Limited 2013
All Rights Reserved
Introduction
• Going to look at 2 scenarios or problems
• One related to issues with server slowdown
and Out Of Memory errors
• One related to consuming JMS messages from
a remote queue and messages dissapearing

© C2B2 Consulting Limited 2013
All Rights Reserved
Scenario 1
• A customer has to restart their servers
regularly as they slow down and become
unresponsive and they see
OutOfMemoryExceptions in the logs
• Restarting the server fixes the problem

© C2B2 Consulting Limited 2013
All Rights Reserved
Out Of Memory Errors
• Two types
– Catastrophic – Rapid rise in memory usage, OOME
occurs and server crashes. Often daily.
– Long running - Gradual slowdown over time (days)
eventually causing an OOME.

© C2B2 Consulting Limited 2013
All Rights Reserved
What to do?
•
•
•
•

Gather information
Analyse the information
Diagnose issues
Resolve the issues

© C2B2 Consulting Limited 2013
All Rights Reserved
Information Gathering
•
•
•
•
•

Verbose GC output
Heap dumps
Server Logs
Stack Traces
Details of system changes

© C2B2 Consulting Limited 2013
All Rights Reserved
Gathering verbose GC data
-verbose:gc
-Xloggc:path_to_log/gc.log
-XX:+PrintGCDetails - causes additional
information about the collections to be printed
-XX:+PrintGCTimeStamps - will add a time
stamp at the start of each collection. This is
useful to see how frequently garbage collections
occur
© C2B2 Consulting Limited 2013
All Rights Reserved
Gathering Heap Dump data
• Make sure the JVM is set to provide a
heapdump on OutOfMemory errors
• This is not a default setting on Sun’s JVM!
• This can be done by adding the following JVM
params:
-XX:-HeapDumpOnOutOfMemoryError
XX:HeapDumpPath=path_to_dump_files/java_pi
d<pid>.hprof
© C2B2 Consulting Limited 2013
All Rights Reserved
Gathering Heap Dump Data manually
• Get the process ID of the running server:
jps – l
• You should see something similar to this:
3171 weblogic.Server -Xms256m -Xmx512m -XX:CompileThreshold=8000 XX:PermSize=128m .........

• Use jmap to take a snapshot
jmap -dump:format=b,file=dump1.bin 3171

© C2B2 Consulting Limited 2013
All Rights Reserved
Gathering stack trace data
• Again, retrieve the process id using jps
• Basic command for getting a stack trace and
outputting it to a file
jstack -l <pid> > jstack-output.txt
• Best to take a series of snapshots, once per
second for at least a minute when slowdown
occurs

© C2B2 Consulting Limited 2013
All Rights Reserved
Analysing the data – GC Logs
• The GC logs will show details of all Garbage
Collection since the server started
• The files are human readable
• Example:
[GC 325407K->83000K(776768K), 0.2300771 secs]
[GC 325816K->83372K(776768K), 0.2454258 secs]
[Full GC 267628K->83769K(776768K), 1.8479984 secs]

© C2B2 Consulting Limited 2013
All Rights Reserved
GCViewer - Standard Behaviour

© C2B2 Consulting Limited 2013
All Rights Reserved
GCViewer - Heap Exhaustion

© C2B2 Consulting Limited 2013
All Rights Reserved
Analysing the data – Heap Dump
• A heap dump contains information about all
Java objects alive at a given point in time
• Not human readable
• Eclipse Memory Analyzer Tool
• Helps in finding memory leaks and discovering
which objects are taking up the most memory

© C2B2 Consulting Limited 2013
All Rights Reserved
Eclipse MAT - Overview

© C2B2 Consulting Limited 2013
All Rights Reserved
MAT – Histogram View

© C2B2 Consulting Limited 2013
All Rights Reserved
MAT – Dominator View

© C2B2 Consulting Limited 2013
All Rights Reserved
Analysing the data – Stack Trace
• Threadlogic
• Quickly understand the health levels and get
details about threads
• Thread groups help in bunching together
related threads

© C2B2 Consulting Limited 2013
All Rights Reserved
Threadlogic – Summary View

© C2B2 Consulting Limited 2013
All Rights Reserved
Threadlogic – Advisory Map

© C2B2 Consulting Limited 2013
All Rights Reserved
Threadlogic – Details View

© C2B2 Consulting Limited 2013
All Rights Reserved
System changes
• Have you deployed any new applications to
the server?
• Any increased load to the system?
• Any updates to the system?
• Are there any fixes or patches related to
memory or performance that you are missing?

© C2B2 Consulting Limited 2013
All Rights Reserved
Prevention
• Audit all system changes and be prepared to
rollback if necessary
• Ensure you log everything if an OOME occurs
• Use monitoring tools to monitor system
behaviour and set up alerts so you’re
forewarned of any anomalous behaviour

© C2B2 Consulting Limited 2013
All Rights Reserved
Problematic JMS
• Consuming messages from a remote queue
• Messages getting lost
• Network exceptions in logs

© C2B2 Consulting Limited 2013
All Rights Reserved
Problematic JMS
• Do you care if messages get lost?
• Can the remote producer be trusted?
• How many (physical) network hops?

© C2B2 Consulting Limited 2013
All Rights Reserved
Problematic JMS
• Use a message bridge
– More reliable than you can code yourself

– Makes adding reliability much easier

© C2B2 Consulting Limited 2013
All Rights Reserved
Problematic JMS
• How complex is your scenario?
– Do you process single units of work over multiple
messages?
– Do you need to load balance JMS across multiple
servers?

© C2B2 Consulting Limited 2013
All Rights Reserved
Problematic JMS
• Which provider should you use?
– Apache ActiveMQ

– Apache Camel
– WebLogic

© C2B2 Consulting Limited 2013
All Rights Reserved

More Related Content

What's hot

How to create a useful my sql bug report fosdem 2019
How to create a useful my sql bug report   fosdem 2019How to create a useful my sql bug report   fosdem 2019
How to create a useful my sql bug report fosdem 2019
Valeriy Kravchuk
 
What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0?
Ambassador Labs
 
Pub/Sub Messaging
Pub/Sub MessagingPub/Sub Messaging
Pub/Sub Messaging
Peter Hanzlik
 
What's New in WildFly 9?
What's New in WildFly 9?What's New in WildFly 9?
What's New in WildFly 9?
Virtual JBoss User Group
 
2020 pre fosdem mysql clone
2020 pre fosdem   mysql clone2020 pre fosdem   mysql clone
2020 pre fosdem mysql clone
Georgi Kodinov
 
MaxScale - The Pluggable Router
MaxScale - The Pluggable RouterMaxScale - The Pluggable Router
MaxScale - The Pluggable Router
MariaDB Corporation
 
Comparing CoAP vs MQTT
Comparing CoAP vs MQTTComparing CoAP vs MQTT
Comparing CoAP vs MQTT
kellogh
 
Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager
Virtual JBoss User Group
 
VMworld 2016: Virtualize Active Directory, the Right Way!
VMworld 2016: Virtualize Active Directory, the Right Way! VMworld 2016: Virtualize Active Directory, the Right Way!
VMworld 2016: Virtualize Active Directory, the Right Way!
VMworld
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
Payara
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
Tobias Koprowski
 
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
WSO2
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservices
Bhakti Mehta
 
VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
Markus Eisele
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdi
Payara
 
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
MariaDB Corporation
 
Analyzing NGINX Logs with Datadog
Analyzing NGINX Logs with DatadogAnalyzing NGINX Logs with Datadog
Analyzing NGINX Logs with Datadog
NGINX, Inc.
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
Sakari Keskitalo
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Geir Høydalsvik
 

What's hot (20)

How to create a useful my sql bug report fosdem 2019
How to create a useful my sql bug report   fosdem 2019How to create a useful my sql bug report   fosdem 2019
How to create a useful my sql bug report fosdem 2019
 
What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0?
 
Pub/Sub Messaging
Pub/Sub MessagingPub/Sub Messaging
Pub/Sub Messaging
 
What's New in WildFly 9?
What's New in WildFly 9?What's New in WildFly 9?
What's New in WildFly 9?
 
2020 pre fosdem mysql clone
2020 pre fosdem   mysql clone2020 pre fosdem   mysql clone
2020 pre fosdem mysql clone
 
MaxScale - The Pluggable Router
MaxScale - The Pluggable RouterMaxScale - The Pluggable Router
MaxScale - The Pluggable Router
 
Comparing CoAP vs MQTT
Comparing CoAP vs MQTTComparing CoAP vs MQTT
Comparing CoAP vs MQTT
 
Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager Narayana 5: The premier open source transaction manager
Narayana 5: The premier open source transaction manager
 
VMworld 2016: Virtualize Active Directory, the Right Way!
VMworld 2016: Virtualize Active Directory, the Right Way! VMworld 2016: Virtualize Active Directory, the Right Way!
VMworld 2016: Virtualize Active Directory, the Right Way!
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
Taking Your Enterprise to the Next Level with WSO2 Message Broker and WSO2 En...
 
Expect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservicesExpect the unexpected: Prepare for failures in microservices
Expect the unexpected: Prepare for failures in microservices
 
VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!VMworld 2015: Virtualize Active Directory, the Right Way!
VMworld 2015: Virtualize Active Directory, the Right Way!
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdi
 
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
 
Analyzing NGINX Logs with Datadog
Analyzing NGINX Logs with DatadogAnalyzing NGINX Logs with Datadog
Analyzing NGINX Logs with Datadog
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
 

Similar to Java Middleware Surgery

Tungsten University: Setup & Operate Tungsten Replicator
Tungsten University: Setup & Operate Tungsten ReplicatorTungsten University: Setup & Operate Tungsten Replicator
Tungsten University: Setup & Operate Tungsten Replicator
Continuent
 
Information Security Lesson 4 - Baselines - Eric Vanderburg
Information Security Lesson 4 - Baselines - Eric VanderburgInformation Security Lesson 4 - Baselines - Eric Vanderburg
Information Security Lesson 4 - Baselines - Eric Vanderburg
Eric Vanderburg
 
STE_DailyHC_TSMV6.pptx
STE_DailyHC_TSMV6.pptxSTE_DailyHC_TSMV6.pptx
STE_DailyHC_TSMV6.pptx
RaulRamirez547593
 
NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5UniFabric
 
3 cucm database
3 cucm database3 cucm database
3 cucm database
pasabakac
 
IBM MQ Disaster Recovery
IBM MQ Disaster RecoveryIBM MQ Disaster Recovery
IBM MQ Disaster Recovery
MarkTaylorIBM
 
GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy
C2B2 Consulting
 
L11 system maintenance
L11 system maintenanceL11 system maintenance
L11 system maintenanceOMWOMA JACKSON
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
LarryZaman
 
DB2 pureScale Overview Sept 2010
DB2 pureScale Overview Sept 2010DB2 pureScale Overview Sept 2010
DB2 pureScale Overview Sept 2010
Laura Hood
 
Why everyone speaks about DR but only few use it?
Why everyone speaks about DR but only few use it?Why everyone speaks about DR but only few use it?
Why everyone speaks about DR but only few use it?
Francisco Alvarez
 
New Generation Oracle RAC Performance
New Generation Oracle RAC PerformanceNew Generation Oracle RAC Performance
New Generation Oracle RAC Performance
Anil Nair
 
Managing bitlocker with MBAM
Managing bitlocker with MBAMManaging bitlocker with MBAM
Managing bitlocker with MBAM
Olav Tvedt
 
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
xKinAnx
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSMongoDB
 
CSF18 - GDPR - Sami Laiho
CSF18 - GDPR - Sami LaihoCSF18 - GDPR - Sami Laiho
CSF18 - GDPR - Sami Laiho
NCCOMMS
 
Sql disaster recovery
Sql disaster recoverySql disaster recovery
Sql disaster recovery
Sqlperfomance
 
New Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael MarthNew Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael MarthAEM HUB
 
Securing with Sophos - Sophos Day Belux 2014
Securing with Sophos - Sophos Day Belux 2014Securing with Sophos - Sophos Day Belux 2014
Securing with Sophos - Sophos Day Belux 2014
Sophos Benelux
 

Similar to Java Middleware Surgery (20)

Tungsten University: Setup & Operate Tungsten Replicator
Tungsten University: Setup & Operate Tungsten ReplicatorTungsten University: Setup & Operate Tungsten Replicator
Tungsten University: Setup & Operate Tungsten Replicator
 
Information Security Lesson 4 - Baselines - Eric Vanderburg
Information Security Lesson 4 - Baselines - Eric VanderburgInformation Security Lesson 4 - Baselines - Eric Vanderburg
Information Security Lesson 4 - Baselines - Eric Vanderburg
 
STE_DailyHC_TSMV6.pptx
STE_DailyHC_TSMV6.pptxSTE_DailyHC_TSMV6.pptx
STE_DailyHC_TSMV6.pptx
 
NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5
 
3 cucm database
3 cucm database3 cucm database
3 cucm database
 
IBM MQ Disaster Recovery
IBM MQ Disaster RecoveryIBM MQ Disaster Recovery
IBM MQ Disaster Recovery
 
GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy GeeCon- 'www.NoSQL.com' by Mark Addy
GeeCon- 'www.NoSQL.com' by Mark Addy
 
System_Idle_Application
System_Idle_ApplicationSystem_Idle_Application
System_Idle_Application
 
L11 system maintenance
L11 system maintenanceL11 system maintenance
L11 system maintenance
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
 
DB2 pureScale Overview Sept 2010
DB2 pureScale Overview Sept 2010DB2 pureScale Overview Sept 2010
DB2 pureScale Overview Sept 2010
 
Why everyone speaks about DR but only few use it?
Why everyone speaks about DR but only few use it?Why everyone speaks about DR but only few use it?
Why everyone speaks about DR but only few use it?
 
New Generation Oracle RAC Performance
New Generation Oracle RAC PerformanceNew Generation Oracle RAC Performance
New Generation Oracle RAC Performance
 
Managing bitlocker with MBAM
Managing bitlocker with MBAMManaging bitlocker with MBAM
Managing bitlocker with MBAM
 
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMS
 
CSF18 - GDPR - Sami Laiho
CSF18 - GDPR - Sami LaihoCSF18 - GDPR - Sami Laiho
CSF18 - GDPR - Sami Laiho
 
Sql disaster recovery
Sql disaster recoverySql disaster recovery
Sql disaster recovery
 
New Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael MarthNew Repository in AEM 6 by Michael Marth
New Repository in AEM 6 by Michael Marth
 
Securing with Sophos - Sophos Day Belux 2014
Securing with Sophos - Sophos Day Belux 2014Securing with Sophos - Sophos Day Belux 2014
Securing with Sophos - Sophos Day Belux 2014
 

More from C2B2 Consulting

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
C2B2 Consulting
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
C2B2 Consulting
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA Suite
C2B2 Consulting
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
C2B2 Consulting
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
C2B2 Consulting
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performance
C2B2 Consulting
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!
C2B2 Consulting
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShift
C2B2 Consulting
 
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
C2B2 Consulting
 
Jax London 2013
Jax London 2013Jax London 2013
Jax London 2013
C2B2 Consulting
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker'
C2B2 Consulting
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
C2B2 Consulting
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
C2B2 Consulting
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
C2B2 Consulting
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
C2B2 Consulting
 
Monitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring InsightMonitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring Insight
C2B2 Consulting
 
Middleware Expert Support Presentation
Middleware Expert Support PresentationMiddleware Expert Support Presentation
Middleware Expert Support Presentation
C2B2 Consulting
 
Monitoring Production JBoss with JBoss ON
Monitoring Production JBoss with JBoss ONMonitoring Production JBoss with JBoss ON
Monitoring Production JBoss with JBoss ON
C2B2 Consulting
 
Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...
Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...
Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...
C2B2 Consulting
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
C2B2 Consulting
 

More from C2B2 Consulting (20)

Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
 
Hands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx PolandHands-on Performance Tuning Lab - Devoxx Poland
Hands-on Performance Tuning Lab - Devoxx Poland
 
Monitoring Oracle SOA Suite
Monitoring Oracle SOA SuiteMonitoring Oracle SOA Suite
Monitoring Oracle SOA Suite
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
 
Building WebLogic Domains With WLST
Building WebLogic Domains With WLSTBuilding WebLogic Domains With WLST
Building WebLogic Domains With WLST
 
Hands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performanceHands-on Performance Workshop - The science of performance
Hands-on Performance Workshop - The science of performance
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!
 
JBoss Clustering on OpenShift
JBoss Clustering on OpenShiftJBoss Clustering on OpenShift
JBoss Clustering on OpenShift
 
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
Dr. Low Latency or: How I Learned to Stop Worrying about Pauses and Love the ...
 
Jax London 2013
Jax London 2013Jax London 2013
Jax London 2013
 
'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker' 'Deploying with GlassFish & Docker'
'Deploying with GlassFish & Docker'
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
 
'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin'New JMS features in GlassFish 4.0' by Nigel Deakin
'New JMS features in GlassFish 4.0' by Nigel Deakin
 
Coherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-webCoherence sig-nfr-web-tier-scaling-using-coherence-web
Coherence sig-nfr-web-tier-scaling-using-coherence-web
 
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at ScaleJUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
JUDCon 2013- JBoss Data Grid and WebSockets: Delivering Real Time Push at Scale
 
Monitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring InsightMonitoring VMware vFabric with Hyperic and Spring Insight
Monitoring VMware vFabric with Hyperic and Spring Insight
 
Middleware Expert Support Presentation
Middleware Expert Support PresentationMiddleware Expert Support Presentation
Middleware Expert Support Presentation
 
Monitoring Production JBoss with JBoss ON
Monitoring Production JBoss with JBoss ONMonitoring Production JBoss with JBoss ON
Monitoring Production JBoss with JBoss ON
 
Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...
Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...
Pushing Oracle Coherence Events to Web Browsers Using HTML5, Web Sockets and ...
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

Java Middleware Surgery

  • 1. Java Middleware Surgery Andy Overton & Mike Croft Expert Support Team © C2B2 Consulting Limited 2013 All Rights Reserved
  • 2. Introduction • Going to look at 2 scenarios or problems • One related to issues with server slowdown and Out Of Memory errors • One related to consuming JMS messages from a remote queue and messages dissapearing © C2B2 Consulting Limited 2013 All Rights Reserved
  • 3. Scenario 1 • A customer has to restart their servers regularly as they slow down and become unresponsive and they see OutOfMemoryExceptions in the logs • Restarting the server fixes the problem © C2B2 Consulting Limited 2013 All Rights Reserved
  • 4. Out Of Memory Errors • Two types – Catastrophic – Rapid rise in memory usage, OOME occurs and server crashes. Often daily. – Long running - Gradual slowdown over time (days) eventually causing an OOME. © C2B2 Consulting Limited 2013 All Rights Reserved
  • 5. What to do? • • • • Gather information Analyse the information Diagnose issues Resolve the issues © C2B2 Consulting Limited 2013 All Rights Reserved
  • 6. Information Gathering • • • • • Verbose GC output Heap dumps Server Logs Stack Traces Details of system changes © C2B2 Consulting Limited 2013 All Rights Reserved
  • 7. Gathering verbose GC data -verbose:gc -Xloggc:path_to_log/gc.log -XX:+PrintGCDetails - causes additional information about the collections to be printed -XX:+PrintGCTimeStamps - will add a time stamp at the start of each collection. This is useful to see how frequently garbage collections occur © C2B2 Consulting Limited 2013 All Rights Reserved
  • 8. Gathering Heap Dump data • Make sure the JVM is set to provide a heapdump on OutOfMemory errors • This is not a default setting on Sun’s JVM! • This can be done by adding the following JVM params: -XX:-HeapDumpOnOutOfMemoryError XX:HeapDumpPath=path_to_dump_files/java_pi d<pid>.hprof © C2B2 Consulting Limited 2013 All Rights Reserved
  • 9. Gathering Heap Dump Data manually • Get the process ID of the running server: jps – l • You should see something similar to this: 3171 weblogic.Server -Xms256m -Xmx512m -XX:CompileThreshold=8000 XX:PermSize=128m ......... • Use jmap to take a snapshot jmap -dump:format=b,file=dump1.bin 3171 © C2B2 Consulting Limited 2013 All Rights Reserved
  • 10. Gathering stack trace data • Again, retrieve the process id using jps • Basic command for getting a stack trace and outputting it to a file jstack -l <pid> > jstack-output.txt • Best to take a series of snapshots, once per second for at least a minute when slowdown occurs © C2B2 Consulting Limited 2013 All Rights Reserved
  • 11. Analysing the data – GC Logs • The GC logs will show details of all Garbage Collection since the server started • The files are human readable • Example: [GC 325407K->83000K(776768K), 0.2300771 secs] [GC 325816K->83372K(776768K), 0.2454258 secs] [Full GC 267628K->83769K(776768K), 1.8479984 secs] © C2B2 Consulting Limited 2013 All Rights Reserved
  • 12. GCViewer - Standard Behaviour © C2B2 Consulting Limited 2013 All Rights Reserved
  • 13. GCViewer - Heap Exhaustion © C2B2 Consulting Limited 2013 All Rights Reserved
  • 14. Analysing the data – Heap Dump • A heap dump contains information about all Java objects alive at a given point in time • Not human readable • Eclipse Memory Analyzer Tool • Helps in finding memory leaks and discovering which objects are taking up the most memory © C2B2 Consulting Limited 2013 All Rights Reserved
  • 15. Eclipse MAT - Overview © C2B2 Consulting Limited 2013 All Rights Reserved
  • 16. MAT – Histogram View © C2B2 Consulting Limited 2013 All Rights Reserved
  • 17. MAT – Dominator View © C2B2 Consulting Limited 2013 All Rights Reserved
  • 18. Analysing the data – Stack Trace • Threadlogic • Quickly understand the health levels and get details about threads • Thread groups help in bunching together related threads © C2B2 Consulting Limited 2013 All Rights Reserved
  • 19. Threadlogic – Summary View © C2B2 Consulting Limited 2013 All Rights Reserved
  • 20. Threadlogic – Advisory Map © C2B2 Consulting Limited 2013 All Rights Reserved
  • 21. Threadlogic – Details View © C2B2 Consulting Limited 2013 All Rights Reserved
  • 22. System changes • Have you deployed any new applications to the server? • Any increased load to the system? • Any updates to the system? • Are there any fixes or patches related to memory or performance that you are missing? © C2B2 Consulting Limited 2013 All Rights Reserved
  • 23. Prevention • Audit all system changes and be prepared to rollback if necessary • Ensure you log everything if an OOME occurs • Use monitoring tools to monitor system behaviour and set up alerts so you’re forewarned of any anomalous behaviour © C2B2 Consulting Limited 2013 All Rights Reserved
  • 24. Problematic JMS • Consuming messages from a remote queue • Messages getting lost • Network exceptions in logs © C2B2 Consulting Limited 2013 All Rights Reserved
  • 25. Problematic JMS • Do you care if messages get lost? • Can the remote producer be trusted? • How many (physical) network hops? © C2B2 Consulting Limited 2013 All Rights Reserved
  • 26. Problematic JMS • Use a message bridge – More reliable than you can code yourself – Makes adding reliability much easier © C2B2 Consulting Limited 2013 All Rights Reserved
  • 27. Problematic JMS • How complex is your scenario? – Do you process single units of work over multiple messages? – Do you need to load balance JMS across multiple servers? © C2B2 Consulting Limited 2013 All Rights Reserved
  • 28. Problematic JMS • Which provider should you use? – Apache ActiveMQ – Apache Camel – WebLogic © C2B2 Consulting Limited 2013 All Rights Reserved

Editor's Notes

  1. Hi, My name is Andy Overton. I head up the Expert Support team at C2B2 and alongside me is my colleague Mike Croft who is also a member of the Expert support team.We&apos;ve had a number of questions but many of them have been very specific regarding a particular application. Therefore we&apos;ve decided to look at a couple of scenarios which will hopefully be more relevant to everybody and will cover a number of the issues people have raised.
  2. This is a fairly common error or issue that we see.
  3. Catastrophic - where we get a rapid rise in memory usage, an OOME occurs and the server keels over.Long running - where we see a gradual slowown over time (days) eventually causing an OOME. Can often be more difficult to detect.
  4. When problems do occur, particularly for production systems, time taken to resolve the issue is always key, whether that means time taken to restore the affected system to a stable, consistent and usable state or time taken to do root cause analysis to determine the cause and preventative measures to put in place.You need to ensure you gather as much information as possible to help diagnose any issues. You then need to analyse that information and we’ll cover a number of tools that we use for doing so. Then, hopefully, from that analysis you should gain a better understanding of what is causing the issue. This should then enable you to come up with a solution in order to resolve the issue.
  5. In an ideal world we&apos;d have all the information needed when the error occurs that we can diagnose the issue and fix it without having to wait for it to happen again. Unfortunately we find that in most production systems the information needed when this kind of issue occurs is not there. The kind of info we are looking for:Verbose GC – Look at garbage collectionHeap Dumps – Allow us to see what is being stored in memoryServer Logs – So we can view any errors that have occurred that may contribute to the issueStack Traces – So we can see any long running threads, stuck threads or other threading issuesDetails of system changes – Generally, when problems occur it is shortly after changes were made to the system.
  6. Verbose GC output is a very lightweight process which will make negligible difference to performance in almost all scenarios. Most of the work to produce the output will be done by the garbage collector anyway, so setting –verbose:gc will just save this data to a log file.In theory, memory leaks should not happen in Java because it has Garbage Collection (GC). However, GC only cleans up unused objects that are not referenced anymore. Therefore, if an object is not used, but is still referenced, GC does not remove it, which leads to memory leaks. Beside memory leaks, other memory problems that you might encounter are memory fragmentation, large objects, and tuning problems. In many cases, these memory problems can cause the application server to crash. Many users first notice that application server performance gradually declines, and eventually crashes with OutOfMemory exceptions.
  7. You need to ensure that when an OOME occurs you take a heap dump. This is a snapshot of everything loaded into memory at the time of the crash. This is not done by default but is easy to do by adding a couple of JVM parameters.
  8. You can also take a snapshot manually using jmap a tool that comes with the JVM
  9. Best to take a series of snapshots, once per second for at least a minute when slowdown occurs. This allows you to look for trends over time such as long running threads, stuck threads or threads that are waiting.
  10. Here we see two minor collections followed by one major collection. The numbers before and after the arrow indicate the combined size of live objects before and after garbage collection, respectively. The next number in parentheses (e.g., (776768K) again from the first line) is the committed size of the heap: the amount of space usable for java objects without requesting more memory from the operating system. The last item on the line (e.g., 0.2300771 secs) indicates the time taken to perform the collection; in this case approximately a quarter of a second.Whilst you can read them we would advise using a graphical tool such as GCViewer as this make it much easier to view what is happening over time.
  11. The most important things to look at in the GCViewer analysis are the* Acc Pauses - Accumulated Pause Time (total time app was stopped for GC).Pauses are the times when an application appears unresponsive because garbage collection is occurring* Total Time - Total Time the application runs.* Throughput - Time the application runs and is not busy with GC. Greater than 99% is fantastic. Throughput is the percentage of total time not spent in garbage collection, considered over long periods of time.* Footprint - Overall Memory Consumption - Ideally as low as possible. This is the working set of a process, measured in pages and cache lines. On systems with limited physical memory or many processes, footprint may dictate scalability. Thus this usually reflects the size of total Heap allocated via Xms and XmxProbably the two most important lines in the graph are the red and the blue line. The red line indicates the total heap size, the blue line shows how much of the heap is actually used.
  12. Here we can see that something is clearly amiss! We are seeing repeated full GC’s and yet the heap size is continuing to grow. This is a sure sign of some form of memory leak and a pre-cursor to heap exhaustion, which will generally be followed by a system crash.
  13. A heap dump contains details of all objects on the heap at a given point in time. The files produced are not human readable and the best tool we find for analysing heap dumps is MAT.
  14. Landing page of MAT report that provides access to multiple types of heap analysis
  15. Select the histogram from the tool bar to list the number of instances per class, the shallow size and the retained size .Generally speaking, shallow heap of an object is its size in the heap and retained size of the same object is the amount of heap memory that will be freed when the object is garbage collected.
  16. All classes with their fields/references. The dominator tree displays the biggest objects in the heap dump. You can expand each item to see other objects referenced by it. The next level of the tree lists those objects that would be garbage collected if all incoming references to the parent node were removed.The dominator tree is a powerful tool to investigate which objects keep which other objects aliveThis way you can nail down the biggest memory hog and also the class/object that holds a reference to it there by preventing it from being garbage collected.
  17. Whilst the files produced are human readable, thread dump or stack trace analysis can be very complex. To make things simpler we advise using a tool such as Threadlogic. It can save a lot of time searching through multiple files trying to visualise what is going on.
  18. This provides the Summary of the threads. We can see the grouping of the threads. It is based on Functionality or ThreadGroup.
  19. We can see the advisory map of all the Threads. The Keyword provides the categorisation of the thread. We can also see a description of the thread and the Advice for the thread.
  20. We can see the status, detailed Description and Advice of the selected thread.
  21. We often find that when asked people will generally state that nothing has changed but generally when issues like this occur a change has taken place. However, the majority of problems that we see are caused by changes being made.
  22. You should always keep an audit of all system changes no matter how minor they may seem.Make sure that logging is in place so that when errors like this do occur you have the data available without having to wait for another system crash.Monitoring tools are invaluable for keeping track of normal behaviour and being able to detect issues early, particularly as you can set up alerts to warn you of things such as large CPU usage or in our case memory usage.