SlideShare a Scribd company logo
1 of 22
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 LanguageSteven 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 BigSQLPiotr 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 OptionGuatemala User Group
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2Aditya Bhuyan
 
A-Project Report- SSIS
A-Project Report- SSISA-Project Report- SSIS
A-Project Report- SSISYubaraj Khanal
 
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 QuestionsNaveen 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 KnowAlex 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_questionsNaveen 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-questionsNaveen 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 AdministrationKylieJonathan
 
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

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.pptxSuKimAnhCTU
 
Sql server performance tuning
Sql server performance tuningSql server performance tuning
Sql server performance tuningJugal Shah
 
Weblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuningWeblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuningAditya Bhuyan
 
Weblogic performance tuning1
Weblogic performance tuning1Weblogic performance tuning1
Weblogic performance tuning1Aditya Bhuyan
 
Weblogic Cluster performance tuning
Weblogic Cluster performance tuningWeblogic Cluster performance tuning
Weblogic Cluster performance tuningAditya 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 developersIke Ellis
 
ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14andrejusb
 
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 architectureSoumya Das
 
User-space Network Processing
User-space Network ProcessingUser-space Network Processing
User-space Network ProcessingRyousei 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 Answersdouglascarnicelli
 
Webcenter application performance tuning guide
Webcenter application performance tuning guideWebcenter application performance tuning guide
Webcenter application performance tuning guideVinay Kumar
 
PostGreSQL Performance Tuning
PostGreSQL Performance TuningPostGreSQL Performance Tuning
PostGreSQL Performance TuningMaven Logix
 
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

A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfUK Journal
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 

Recently uploaded (20)

A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 

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.