SlideShare a Scribd company logo
Analyzing a memory leak
problem
Finding the relationship between a
misconfigured DBAdapter and a
memory leak problem
Symptoms
An OSB installation suddenly crashed after
having performance problem during several
hours and this message was found in the log
files.
java.lang.OutOfMemoryError: Java heap space
Current configuration
• I tuned that OSB installation in 2015 with this parameters
if "%SERVER_NAME%"=="osb_server1" (
set USER_MEM_ARGS=-Xms6144M -Xmx6144M -Xmn1536M -
XX:PermSize=2048M -XX:MaxPermSize=2048M -Xss256K -
XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:+UseParallelOldGC
-XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -
XX:MaxTenuringThreshold=15 -XX:-UseAdaptiveSizePolicy -
XX:+DisableExplicitGC -Dweblogic.threadpool.MinPoolSize=50 -
XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -
XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -
XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M -
Xloggc:D:u01configdomainssoa_domainserversosb_server1logs
gclog_osb.txt
)
Analyzing the root cause
• One of the first things to solve this kind of problem is
analyzing heap dumps to see which classes are
depleting the memory.
• In this case, I used two different tools Eclipse Memory
Analyzer Tool (MAT) and IBM Heap Analyzer to analyze
two heaps
• I have to remark that this parameter -
XX:+HeapDumpOnOutOfMemoryError I configured in
2015 is useful in these cases because we can get the
information generated in the heap just before the crash
Using MAT on a 3GB heap dump
In this case Memory Analyser Tool
(MAT) shows the first suspect for the
leak is the class called:
org.eclipse.persistence.internal.sessio
ns.IsolatedClientSession, which was
occupying the 57.28% of the heap as
can be seen in this figure.
It looks like a memory leak that can be
caused by some methods related to
TopLink
Using MAT on a 3GB heap dump
MAT also shows the second suspect
for the memory leak, which is the class
called java.lang.ref.Finalizer as can be
seen in the following figure.
This is interesting because the
finalization of resources is related to
the misuse of resources such as files,
data sources, sockets, etc.
Using IBM Heap Analyzer on a 3GB heap dump
IBM Heap Analyzer has discovered an important relationship between
java.lang.ref.finalizer and TopLink, this can be seen in this text.
At this point we can have a hypothesis, the responsible of the problem is related to the
persistence of objects using Oracle TopLink and Java Connector Architecture like
oracle/tip/adapter/sa/impl/inboundJCABindingActivationAgent
Using MAT on a 6GB heap dump
In this case MAT shows the main suspects related to the finalization of objects
and Oracle TopLink as can be seen in the following report.
Using MAT on a 6GB heap dump
In addition, the Dominator Tree was analysed in detail for this case and it has
shown that many of the Finalizers are not only related to TopLink, but they are
related to a specific driver to connect to MS-SQL databases.
Using MAT on a 6GB heap dump
It means the problem can be caused by the misuse or misconfiguration of
TopLink or perhaps because of a bug related to this product. However, according
to page of Eclipse 2.5.2 (version used on that server) between its known bugs,
there are no any bug related to memory leaks. This is the list of bugs for Eclipse
2.5.2
Using MAT on a 6GB heap dump
Nevertheless, the most important fact in this case is the relationship with many
objects used to set a connection with the MS-SQL database.
With this in mind, in the following section two connection pools related to SQL
Server are analysed and tuned.
Analysing and tuning connection pools related to MS
SQL Server
These are the most used data sources
Both data sources connect the system to MS-SQL Server, which makes sense with
the amount of objects shown in the heap. Since many problems related to the
finalization of objects are related to leak of resources such as connection pools, files,
sockets, etc. One of the goals of the tuning process is to set a timeout for inactive
JDBC connections. More details about these problems can be found here:
http://blog.sysco.no/db/locking/jdbc-leak/
Following, the tuning process for both data sources is shown
Data source one
You can see the lack of “testing connections on reserve” to avoid problems with
dirty connections and the lack of a timeout for inactive connections, which can
generate JDBC connection leaks due to bugs, misconfigurations or programming
errors. The configuration was changed to use test connection on reserve and to
use a timeout equal to 600s
Data source two
I found this configuration
This case was strange because the
test table name had the query “SQL
Select 1 from dual”. However, when
a data source that points to MS-SQL
Server is created the by default
query generated by Weblogic
console is “SQL Select 1”. Thus, it
seems to be this data source was
modified to point to MS-SQL Server
instead of Oracle.
Data source two
In addition, when I used the Administrative Console to tune the Data Source the
following error was issued just when the Test Table Name was modified.
Therefore, this datasource was deleted and created again to fix the test table
name, to activate test connection on reserve and to set the timeout to 600s
Looking for leaking of connections (JDBC) after
tuning connection pools
After modifying connection pools the system was monitored between 17:00 and
23:50 and a JDBC connection leak related to the data sources was detected. This
is shown in the following figure
Looking for leaking of connections (JDBC)
after tuning connection pools
With this in mind, the log file was checked to find the source code that does not
close resources properly. The following figure shows the source code discovered.
Looking for leaking of connections (JDBC)
after tuning connection pools
Again, some objects related to Oracle TopLink are responsible for a leak, of
resources in this case, which can be related to the problem on finalizers shown
in previous sections when the memory leak was analysed. Hence, it is necessary
to review the DBAdapter configuration or looking for some bugs related to
TopLink or some programming or modelling errors.
Analysing DBAdapters and outbound
connections
During the analysis of this, it was found a problem on the DbAdapter related to
one of the data sources shown previously because it was using a
PlatformClassName for Oracle databases to connect to a data source that points
to an MS-SQL Server data base. This was the misconfiguration found.
Analysing DBAdapters and outbound
connections
This configuration was fixed to use a proper PlatformClassName for MS-SQL
Server and now it looks like this.
Monitoring the heap after fixing the DBAdapter
and tuning the CP
We do not have Full GC, which mean the Old Generation has not been depleted. In addition, the
amount of memory used on the Old Generation was almost 1,6 GB from 4,5 GB available, which
means most objects are dying at the Young generation (weak generational hypothesis). This log was
generated using -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -
XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M
Conclusions and recommendations
According to the analysis done, the memory leak problem, which at the beginning seemed to be a
bug of TopLink was caused by the misconfiguration of outbound connections within the
DBAdapter. In this particular case, the problem was caused by the use of a PlatformClassName
oriented to Oracle databases to work with a MS-SQL Server Database.
Furthermore, due to this error with the PlaformClassName and the wrong test table name, it looks
like this outbound connection and its data source had been used to point to Oracle before. Thus, if
this is the case the recommendation is to review the impact of migrations and configurations
before applying them on the application servers.

More Related Content

What's hot

Dba 3+ exp qus
Dba 3+ exp qusDba 3+ exp qus
Dba 3+ exp quskrreddy21
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL Language
Steven Feuerstein
 
Hands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQL
Hands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQLHands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQL
Hands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQL
Piotr Pruski
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
Alex Zaballa
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL Option
Guatemala User Group
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
Aditya Bhuyan
 
A-Project Report- SSIS
A-Project Report- SSISA-Project Report- SSIS
A-Project Report- SSISYubaraj Khanal
 
Weblogic plug in
Weblogic plug inWeblogic plug in
Weblogic plug in
Aditya Bhuyan
 
Less18 moving data
Less18 moving dataLess18 moving data
Less18 moving dataImran Ali
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
Naveen P
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Less08 managing data and concurrency
Less08 managing data and concurrencyLess08 managing data and concurrency
Less08 managing data and concurrencyImran Ali
 
Oracle DBA interview_questions
Oracle DBA interview_questionsOracle DBA interview_questions
Oracle DBA interview_questions
Naveen P
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)
than sare
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
Naveen P
 
Exam 1z0 062 Oracle Database 12c: Installation and Administration
Exam 1z0 062 Oracle Database 12c: Installation and AdministrationExam 1z0 062 Oracle Database 12c: Installation and Administration
Exam 1z0 062 Oracle Database 12c: Installation and Administration
KylieJonathan
 
Less17 flashback tb3
Less17 flashback tb3Less17 flashback tb3
Less17 flashback tb3Imran Ali
 
User Manual_SQLVB Report Tool v2
User Manual_SQLVB Report Tool v2User Manual_SQLVB Report Tool v2
User Manual_SQLVB Report Tool v2Russell Frearson
 

What's hot (20)

Dba 3+ exp qus
Dba 3+ exp qusDba 3+ exp qus
Dba 3+ exp qus
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL Language
 
Hands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQL
Hands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQLHands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQL
Hands-on-Lab: Adding Value to HBase with IBM InfoSphere BigInsights and BigSQL
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL Option
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
 
A-Project Report- SSIS
A-Project Report- SSISA-Project Report- SSIS
A-Project Report- SSIS
 
Weblogic plug in
Weblogic plug inWeblogic plug in
Weblogic plug in
 
Less18 moving data
Less18 moving dataLess18 moving data
Less18 moving data
 
DBA 3 year Interview Questions
DBA 3 year Interview QuestionsDBA 3 year Interview Questions
DBA 3 year Interview Questions
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowOTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
 
Less08 managing data and concurrency
Less08 managing data and concurrencyLess08 managing data and concurrency
Less08 managing data and concurrency
 
Oracle DBA interview_questions
Oracle DBA interview_questionsOracle DBA interview_questions
Oracle DBA interview_questions
 
Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)Mid term & final- preparation- student-review(Oracle)
Mid term & final- preparation- student-review(Oracle)
 
Database Connection Pane
Database Connection PaneDatabase Connection Pane
Database Connection Pane
 
All Oracle-dba-interview-questions
All Oracle-dba-interview-questionsAll Oracle-dba-interview-questions
All Oracle-dba-interview-questions
 
Exam 1z0 062 Oracle Database 12c: Installation and Administration
Exam 1z0 062 Oracle Database 12c: Installation and AdministrationExam 1z0 062 Oracle Database 12c: Installation and Administration
Exam 1z0 062 Oracle Database 12c: Installation and Administration
 
Less17 flashback tb3
Less17 flashback tb3Less17 flashback tb3
Less17 flashback tb3
 
User Manual_SQLVB Report Tool v2
User Manual_SQLVB Report Tool v2User Manual_SQLVB Report Tool v2
User Manual_SQLVB Report Tool v2
 

Similar to Analyzing a memory leak problem

Mule jdbc
Mule   jdbcMule   jdbc
http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151xlight
 
Java-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptxJava-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptx
SuKimAnhCTU
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuning
Jugal Shah
 
Weblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuningWeblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuning
Aditya Bhuyan
 
Weblogic performance tuning1
Weblogic performance tuning1Weblogic performance tuning1
Weblogic performance tuning1
Aditya Bhuyan
 
Weblogic Cluster performance tuning
Weblogic Cluster performance tuningWeblogic Cluster performance tuning
Weblogic Cluster performance tuning
Aditya Bhuyan
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developers
Ike Ellis
 
ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14
andrejusb
 
Spring framework DAO
Spring framework  DAOSpring framework  DAO
Spring framework DAO
Anuj Singh Rajput
 
Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...
Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...
Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...djkucera
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
Soumya Das
 
User-space Network Processing
User-space Network ProcessingUser-space Network Processing
User-space Network Processing
Ryousei Takano
 
2020 New Updated 1Z0-060 Questions and Answers
2020 New Updated 1Z0-060 Questions and Answers2020 New Updated 1Z0-060 Questions and Answers
2020 New Updated 1Z0-060 Questions and Answers
douglascarnicelli
 
Webcenter application performance tuning guide
Webcenter application performance tuning guideWebcenter application performance tuning guide
Webcenter application performance tuning guide
Vinay Kumar
 
PostGreSQL Performance Tuning
PostGreSQL Performance TuningPostGreSQL Performance Tuning
PostGreSQL Performance Tuning
Maven Logix
 
What's next after Upgrade to 12c
What's next after Upgrade to 12cWhat's next after Upgrade to 12c
What's next after Upgrade to 12c
Guatemala User Group
 
High Performance Jdbc
High Performance JdbcHigh Performance Jdbc
High Performance JdbcSam Pattsin
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 

Similar to Analyzing a memory leak problem (20)

Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151http://www.hfadeel.com/Blog/?p=151
http://www.hfadeel.com/Blog/?p=151
 
Java-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptxJava-8-Structured-MongoDB.pptx
Java-8-Structured-MongoDB.pptx
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuning
 
Weblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuningWeblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuning
 
Weblogic performance tuning1
Weblogic performance tuning1Weblogic performance tuning1
Weblogic performance tuning1
 
Weblogic Cluster performance tuning
Weblogic Cluster performance tuningWeblogic Cluster performance tuning
Weblogic Cluster performance tuning
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developers
 
ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14
 
MyBatis
MyBatisMyBatis
MyBatis
 
Spring framework DAO
Spring framework  DAOSpring framework  DAO
Spring framework DAO
 
Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...
Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...
Oracle OpenWorld 2011– Leveraging and Enriching the Capabilities of Oracle Da...
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 
User-space Network Processing
User-space Network ProcessingUser-space Network Processing
User-space Network Processing
 
2020 New Updated 1Z0-060 Questions and Answers
2020 New Updated 1Z0-060 Questions and Answers2020 New Updated 1Z0-060 Questions and Answers
2020 New Updated 1Z0-060 Questions and Answers
 
Webcenter application performance tuning guide
Webcenter application performance tuning guideWebcenter application performance tuning guide
Webcenter application performance tuning guide
 
PostGreSQL Performance Tuning
PostGreSQL Performance TuningPostGreSQL Performance Tuning
PostGreSQL Performance Tuning
 
What's next after Upgrade to 12c
What's next after Upgrade to 12cWhat's next after Upgrade to 12c
What's next after Upgrade to 12c
 
High Performance Jdbc
High Performance JdbcHigh Performance Jdbc
High Performance Jdbc
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 

Recently uploaded

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
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
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
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
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
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
 
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
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
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
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
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
 

Recently uploaded (20)

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
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
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
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
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
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
 
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
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
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 !
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
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...
 

Analyzing a memory leak problem

  • 1. Analyzing a memory leak problem Finding the relationship between a misconfigured DBAdapter and a memory leak problem
  • 2. Symptoms An OSB installation suddenly crashed after having performance problem during several hours and this message was found in the log files. java.lang.OutOfMemoryError: Java heap space
  • 3. Current configuration • I tuned that OSB installation in 2015 with this parameters if "%SERVER_NAME%"=="osb_server1" ( set USER_MEM_ARGS=-Xms6144M -Xmx6144M -Xmn1536M - XX:PermSize=2048M -XX:MaxPermSize=2048M -Xss256K - XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:+UseParallelOldGC -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled - XX:MaxTenuringThreshold=15 -XX:-UseAdaptiveSizePolicy - XX:+DisableExplicitGC -Dweblogic.threadpool.MinPoolSize=50 - XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails - XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation - XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M - Xloggc:D:u01configdomainssoa_domainserversosb_server1logs gclog_osb.txt )
  • 4. Analyzing the root cause • One of the first things to solve this kind of problem is analyzing heap dumps to see which classes are depleting the memory. • In this case, I used two different tools Eclipse Memory Analyzer Tool (MAT) and IBM Heap Analyzer to analyze two heaps • I have to remark that this parameter - XX:+HeapDumpOnOutOfMemoryError I configured in 2015 is useful in these cases because we can get the information generated in the heap just before the crash
  • 5. Using MAT on a 3GB heap dump In this case Memory Analyser Tool (MAT) shows the first suspect for the leak is the class called: org.eclipse.persistence.internal.sessio ns.IsolatedClientSession, which was occupying the 57.28% of the heap as can be seen in this figure. It looks like a memory leak that can be caused by some methods related to TopLink
  • 6. Using MAT on a 3GB heap dump MAT also shows the second suspect for the memory leak, which is the class called java.lang.ref.Finalizer as can be seen in the following figure. This is interesting because the finalization of resources is related to the misuse of resources such as files, data sources, sockets, etc.
  • 7. Using IBM Heap Analyzer on a 3GB heap dump IBM Heap Analyzer has discovered an important relationship between java.lang.ref.finalizer and TopLink, this can be seen in this text. At this point we can have a hypothesis, the responsible of the problem is related to the persistence of objects using Oracle TopLink and Java Connector Architecture like oracle/tip/adapter/sa/impl/inboundJCABindingActivationAgent
  • 8. Using MAT on a 6GB heap dump In this case MAT shows the main suspects related to the finalization of objects and Oracle TopLink as can be seen in the following report.
  • 9. Using MAT on a 6GB heap dump In addition, the Dominator Tree was analysed in detail for this case and it has shown that many of the Finalizers are not only related to TopLink, but they are related to a specific driver to connect to MS-SQL databases.
  • 10. Using MAT on a 6GB heap dump It means the problem can be caused by the misuse or misconfiguration of TopLink or perhaps because of a bug related to this product. However, according to page of Eclipse 2.5.2 (version used on that server) between its known bugs, there are no any bug related to memory leaks. This is the list of bugs for Eclipse 2.5.2
  • 11. Using MAT on a 6GB heap dump Nevertheless, the most important fact in this case is the relationship with many objects used to set a connection with the MS-SQL database. With this in mind, in the following section two connection pools related to SQL Server are analysed and tuned.
  • 12. Analysing and tuning connection pools related to MS SQL Server These are the most used data sources Both data sources connect the system to MS-SQL Server, which makes sense with the amount of objects shown in the heap. Since many problems related to the finalization of objects are related to leak of resources such as connection pools, files, sockets, etc. One of the goals of the tuning process is to set a timeout for inactive JDBC connections. More details about these problems can be found here: http://blog.sysco.no/db/locking/jdbc-leak/ Following, the tuning process for both data sources is shown
  • 13. Data source one You can see the lack of “testing connections on reserve” to avoid problems with dirty connections and the lack of a timeout for inactive connections, which can generate JDBC connection leaks due to bugs, misconfigurations or programming errors. The configuration was changed to use test connection on reserve and to use a timeout equal to 600s
  • 14. Data source two I found this configuration This case was strange because the test table name had the query “SQL Select 1 from dual”. However, when a data source that points to MS-SQL Server is created the by default query generated by Weblogic console is “SQL Select 1”. Thus, it seems to be this data source was modified to point to MS-SQL Server instead of Oracle.
  • 15. Data source two In addition, when I used the Administrative Console to tune the Data Source the following error was issued just when the Test Table Name was modified. Therefore, this datasource was deleted and created again to fix the test table name, to activate test connection on reserve and to set the timeout to 600s
  • 16. Looking for leaking of connections (JDBC) after tuning connection pools After modifying connection pools the system was monitored between 17:00 and 23:50 and a JDBC connection leak related to the data sources was detected. This is shown in the following figure
  • 17. Looking for leaking of connections (JDBC) after tuning connection pools With this in mind, the log file was checked to find the source code that does not close resources properly. The following figure shows the source code discovered.
  • 18. Looking for leaking of connections (JDBC) after tuning connection pools Again, some objects related to Oracle TopLink are responsible for a leak, of resources in this case, which can be related to the problem on finalizers shown in previous sections when the memory leak was analysed. Hence, it is necessary to review the DBAdapter configuration or looking for some bugs related to TopLink or some programming or modelling errors.
  • 19. Analysing DBAdapters and outbound connections During the analysis of this, it was found a problem on the DbAdapter related to one of the data sources shown previously because it was using a PlatformClassName for Oracle databases to connect to a data source that points to an MS-SQL Server data base. This was the misconfiguration found.
  • 20. Analysing DBAdapters and outbound connections This configuration was fixed to use a proper PlatformClassName for MS-SQL Server and now it looks like this.
  • 21. Monitoring the heap after fixing the DBAdapter and tuning the CP We do not have Full GC, which mean the Old Generation has not been depleted. In addition, the amount of memory used on the Old Generation was almost 1,6 GB from 4,5 GB available, which means most objects are dying at the Young generation (weak generational hypothesis). This log was generated using -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation - XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M
  • 22. Conclusions and recommendations According to the analysis done, the memory leak problem, which at the beginning seemed to be a bug of TopLink was caused by the misconfiguration of outbound connections within the DBAdapter. In this particular case, the problem was caused by the use of a PlatformClassName oriented to Oracle databases to work with a MS-SQL Server Database. Furthermore, due to this error with the PlaformClassName and the wrong test table name, it looks like this outbound connection and its data source had been used to point to Oracle before. Thus, if this is the case the recommendation is to review the impact of migrations and configurations before applying them on the application servers.