Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 2
Graphic Section Divider
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 3
Troubleshooting, diagnosing and optimizing Oracle E-Business Suite Gustavo Jimenez Senior Development Manager ATG Development Padmaprabodh Ambale Group Manager ATG Development
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 4
Contributors:
Vijay Shanmugam Senior Development Manager
ATG Development
Paul Ferguson Senior Development Manager
ATG Development
Gustavo Jimenez Senior Development Manager
ATG Development
Mike Skees Group Manager
ATG Development
Carlo Beekman Principal Support Engineer
ATG Support
Padmaprabodh Ambale Group Manager
ATG Development
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 5
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 6
Program Agenda
§ Introduction
§ Architecture and challenges
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 7
Program Agenda
§ Troubleshooting Topics – Oracle Application Framework – Java Caching Framework (Powered by Oracle Java Object Cache) – Oracle Forms (Review with Scot) – Oracle Workflow – Application Object Library – Introduction to J2EE container performance optimization. – Concurrent Processing (Appendix) – J2EE container performance optimization in detail(Appendix)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 8
Program Agenda § Useful references
– Related documentation – Forums – Links
§ Q&A
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 9
Diagnosing and troubleshooting challenges
§ High complexity system with complex components
§ Highly customizable product
§ Large number of configuration permutations
§ Configuration errors have a very important cascading effect
§ Backwards compatibility with multiple versions
§ Regular updates
§ Performance versus system load
§ Differences between environments (Production/Test/Development)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 10
Value of understanding
§ Faster problem resolution
§ Reduced interaction
§ Ensure all instance-specific variables and deltas are ruled out.
Getting the most out of Support and Development
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 11
Value of understanding
§ Key: understanding technology components.
§ Differentiate between forms based applications and OAF based applications
§ Diagnose directly on the layer where the problem occurs
§ Communication protocols (HTTP, SQL*Net, Forms over HTTP)
Getting the most out of Support and Development
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 12
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 13
OA Controller
BC4J OAF/UIX
Oracle Application Framework
§ A development framework based on the Model-View-Controller pattern/standard in which all e-Business Suite HTML pages are built. § OAF/UIX à View Layer § BC4J à Database/Model layer
§ Key objective: Isolate the layer where the error occurs
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 14
Cache Entity
Cache Loader
JTF CACHE
JOC
RDBMS
Caching Framework (JOC based)
§ Cache engine designed to prevent round trips to the database from the middle tiers or java applications
§ Additional layer for E-Business Suite (JTF Cache)
§ Handles cached entities, time to live and invalidation events
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 15
Caching Framework (JOC based)
§ Integrates with non-java applications via Business Event System for invalidation events via PL/SQL layer and event propagation.
§ Caches entities with low entropy (Profile options, lookups)
§ High entropy data not suitable for caching
Introduction
Cache Entity
Cache Loader
JTF CACHE
JOC
RDBMS
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 16
Oracle Forms
§ Development tool used to build forms based on database tables
§ Logic built on the PL/SQL engine
§ Runs on a java virtual machine in the client as an applet
§ Communicates with the server via forms protocol over HTTP or sockets (deprecated)
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 17
Oracle Workflow
§ E-Business Suite’s orchestration subsystem – Approval
– Notification mailer
– Business Event System
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 18
Concurrent processing system
§ E-Business Suite daemon for offline/background processing
§ Specialized workers
§ Reporting and mass transactional engine
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 19
AOL/J
§ Core java services § Authentication
§ Authorization
§ Message Dictionary
§ Database connectivity
§ LOVs, Lookups, Profiles, Session Management
§ Internationalization/Localization foundation libraries
Introduction
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 20
Architecture and challenges
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 21
Introduction to e-Business Suite Architecture Basic 3-tier architecture
Database Tier Application Tier Client Tier
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 22
Diagnosing and troubleshooting OAF based applications
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 23
Troubleshooting OAF based applications
§ Scenario #1: Your transaction fails with an error
§ Debug the page that is failing
§ The “FND Diagnostics” profile option
§ Enables additional troubleshooting options
§ SQL Traces
§ On screen logging
§ “About this page” link
What to do when the application errors out?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 24
Troubleshooting OAF based applications
§ When to use:
§ When the page is functional despite the error
What to do when the application errors out?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 25
Troubleshooting OAF based applications
§ Requires FND: Diagnostics = “Yes”
Scenario #1, continued
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 26
Troubleshooting OAF based applications
§ Request parameters § Cookies § Session data § Debug log § BC4J Logging (including queries)
§ TIP: Save this data and upload to your Service Request via MOS
Information retrieved
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 27
Troubleshooting OAF based applications
§ Page fails to render – Verify HTTP traffic between client/server (i.e.: HTTP analyzer) paying
attention to cookies – Use applications logging (AFLOG_ENABLED = “Yes”)
§ Output to a file (AFLOG_FILENAME) if no DB connectivity – Enable BC4J logging to capture queries and BC4J status messages – Verify alert.log file in database tier (example: maxextents reached in
ICX_SESSIONS or ICX_TRANSACTIONS)
Scenario #2
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 28
Troubleshooting OAF based applications
§ Java exceptions, Self explanatory messages § Reach out for help when necessary
– Oracle Support, Forums, Search engines – Custom code
§ Issue reproduces after disabling customizations? § Not supported § Play with Jdeveloper and verify if reproduces
Caveats
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 29
Troubleshooting OAF based applications
§ “About this page” link (requires FND: Diagnostics set to “Yes”) – Shows page structure – Shows BC4J artifacts related to the page – Useful for customizations and extensions – Shows security context for diagnostics purposes – Personalizations, Loaded profile options, Patches, Container properties,
etc. etc.
Important troubleshooting tools
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 30
Troubleshooting OAF based applications
§ Requires “FND: Diagnostics set to “yes”
“About this page” link
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 31
Troubleshooting OAF based applications
§ Files under $PROD_TOP/mds – Retrieved from the database Meta Data System (MDS)
§ Disable personalizations for diagnostic purposes – Functional Administrator à Application Catalog Tool à Individual
personalizations – Disable Self-service Personal / FND_DISABLE_OA_CUSTOMIZATIONS à ALL
Personalizations
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 32
Troubleshooting OAF based applications Personalizations
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 33
Troubleshooting OAF based applications
§ Use SQL*Plus to check personalizations registration § Turn on diagnostics messaging in SQL*Plus § Review what personalization documents exist for a given page
– execute jdr_utils.listcustomizations ('/oracle/apps/fnd/wf/worklist/webui/FullWorklistPG');
Personalizations
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 34
Diagnosing and troubleshooting Java Caching Framework
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 35
Java Caching Framework
§ Cache invalidation (or lack thereof) issues § Distributed vs. Standalone ? Always use Distributed § Always make sure latest patches are applied (JOC AND JTF) § Communication ports: Ensure there are enough available and open in
the firewall, except for DMZs § Number of nodes and communication: Use CacheWatchUtil
Troubleshooting and diagnostics
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 36
Java Caching Framework
§ Cached entities: Use CacheWatchUtil § Most issues might not look cache problems (i.e.: Login page fails to
render due to lack of database connectivity) § Clear the cache § Use Java’s Jconsole tool to verify hit/miss ratio and gather additional
statistics
Troubleshooting and diagnostics
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 37
Java Caching Framework
§ Navigation path: – Functional Administrator
§ Core Services § Caching Framework § Clear all cache
Troubleshooting and diagnostics
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 38
Java Caching Framework
§ For more information see MOS notes: § 454178.1 § 455194.1 § 386568.1
Troubleshooting and diagnostics
Cache Entity
Cache Loader
JTF CACHE
JOC
RDBMS
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 39
Diagnosing and troubleshooting Oracle Workflow
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 40
Oracle Workflow
§ Symptoms – Slower processing of workflow process activities visible in slower
completion of related business processes – Clicking “Approve” button on notification details page taking too long to
return
§ Causes – Huge backlog of obsolete run-time data pending purge – Bad workflow logic such as looping resulting in uncontrolled growth of
workflow run-time tables
WF Engine Performance Issues
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 41
Oracle Workflow
§ Remedy – Schedule Purge Obsolete Workflow Runtime Data (FNDWFPR) to purge
run-time data on regular basis – Make sure workflow processes do not use looping constructs to perform
polling activities – Refer to best practices
WF Engine Performance Issues
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 42
Oracle Workflow
§ Symptoms – Business Event has a valid subscription but when raising it, the
subscription is not executed
§ Causes – Agent Listener(s) may be down – Run-time error in the subscription causing it to be rolled back. Due to
unavailability of Error subscription, it is not reported to SYSADMIN
Business Event System not firing
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 43
Oracle Workflow
§ Remedy – Make sure Workflow Deferred Agent Listener and Workflow Java Deferred
Agent Listeners are up – Make sure each Business Event has a valid Error subscription that uses
WFERROR:DEFAULT_EVENT_ERROR workflow to process business event errors
Business Event System not firing
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 44
Oracle Workflow
§ Symptoms – Business Event System – WF_DEFERRED, WF_JAVA_DEFERRED – Workflow Engine – WF_DEFERRED_QUEUE_M – Too many messages in READY state for too long
§ Causes – Workflow Agent Listener not processing WF_DEFERRED and
WF_JAVA_DEFERRED fast enough – Workflow Background Engine not processing
WF_DEFERRED_QUEUE_M fast enough
Background queues overload
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 45
Oracle Workflow
§ Remedy – Increase Inbound Thread Count for Workflow Agent Listeners – Create dedicated Agent Listeners for specific Business Events – Schedule dedicated Workflow Background Engines for high volume item
types such as POAPPRV, OEOH, OEOL and so on
Background queues overload
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 46
Diagnosing and troubleshooting Oracle Forms-based applications
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 47
Oracle Forms Architecture
Desktop client • Forms Applet • JRE started from browser • User Interface • 1:1 relation with Forms runtime process
Application Server • Listener
• Forms Servlet (http(s)) • OC4J / JSERV • Forms Server (socket) • frmsrv / f60srvm
• Runtime process (1 per session) • frmweb / f60webmx
Database • SQL*NET • Interacts with Forms runtime process
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 48
Oracle Forms
§ Runs in JRE (previous Jinitiator) on the desktop client § Recommend using latest certified version of JRE
– Note: 290807.1 Deploying Sun JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite 11i
– Note: 393931.1 Deploying Sun JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite Release 12
§ Java code for applet downloaded in Forms JAR files
Forms Applet
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 49
Oracle Forms
§ E-Business Suite specific JAR files (fnd<xxxx>.jar) § Generated using ADADMIN utility § JAR files are cached at desktop (per environment) § During Forms startup verification if JAR file on server got changed >> If
so a download is performed
Forms Applet
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 50
Oracle Forms
§ Use latest Forms versions + patches: – Note: 125767.1 Upgrading Developer 6i with Oracle Applications 11i – Note: 437878.1 Upgrading OracleAS 10g Forms and Reports in Oracle E-
Business Suite Release 12 § Forms patch <> Applications patch
– Manual copy (Forms 6i) >> no version control, so be careful !! – Opatch (Forms 10G) checks for patch conflicts
§ Relink Forms executables
Forms patching
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 51
Oracle Forms
§ Forms classes are ‘replaced’ in 3 steps 1. Patch is applied to $ORACLE_HOME 2. ADADMIN builds new FND JAR files based on fndjar.dep 3. New FND JAR files are downloaded to the desktop client when Forms
session starts
Forms patching
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 52
Oracle Forms
§ Java Console: Enable Start > Control Panel > Java § Shows all kind of information and exceptions on
– JAR file download, Java stack trace, versions, protocols used
Desktop troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 53
Oracle Forms
§ Severe errors are shown in Error dialog § FRM- message à always check Details § Most common causes:
– Configuration – Server processes not running – Runtime process crash – Network
§ Refer to MOS Note #444690.1
Desktop Troubleshooting – Runtime errors
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 54
Oracle Forms
§ Help à About Oracle Applications… collect information about Forms session + runtime process on server
§ Set profile FND: Diagnostics = Yes to see all debugging information
Forms session troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 55
Oracle Forms
§ Use Help à Diagnostics to – Start a trace for database session – Examine values of item, variables, environment variables, etc – Database errors
Forms session troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 56
Oracle Forms
§ Creating a FRD trace – Add “?record=collect” parameter to ICX: Forms Launcher – Creates file logging Forms opened, navigations, built-in, errors, user-exits – Resource intensive, so use for ‘dedicated’ Forms session – Note:438652.1 (R12) / Note:150168.1 (R11i)
§ Identify the <PID> of Forms runtime process – Ensure profile FND: Diagnostics = Yes – Found in Help à About Oracle Applications
Troubleshooting at middle tier
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 57
Oracle Forms
§ With the <PID> it’s possible to – Create truss/tusc/strace output for the Forms runtime process – Verify Forms runtime process remains running or crashes – Check dump file created in $FORM(60)_TRACE_PATH
Troubleshooting at middle tier
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 58
Oracle Forms
§ Forms uses ‘fixed’ connection between Forms applet and runtime process using the SOCKET or HTTP(S) protocol
§ Network ‘glitches’ easily cause problems – Forms Server (SOCKET) disconnects session – Forms Servlet (HTTP(S)) use the networkRetries=<x> in appsweb.cfg to
attempt re-establish connection <x> times § FORMS(60)_BLOCK_URL_CHARACTERS in apps.conf
– Prevents Forms startup in case of ‘inappropriate’ character used
Troubleshooting Network
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 59
Oracle Forms
§ The heartBeat in appsweb.cfg < FORMS(60)_TIMEOUT § Work together to kill or keep alive runtime process § Incorrect settings may cause an unwanted termination
Troubleshooting Network
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 60
Oracle Forms
§ Beware of the custom.pll – Ensure no ‘outdated’ versions are around on the file system
§ Location of the FMX / PLX files – Working directory is first checked >> Ensure no files are there – Picked up based on FORMS(60)_PATH
§ FMX / PLX compilation – Performed using ADADMIN utility – Error: Compile from command line to identify root-cause
Troubleshooting miscellaneous
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 61
Oracle Forms
§ (Database) PACKAGE SPEC altered § For performance references to packages fixed at compile time § Change in PACKAGE SPEC require recompilation
Troubleshooting miscellaneous
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 62
Introduction to J2EE container performance optimization
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 63
Defining performance and scalability
§ Performance – Measured via response time
§ Scalability – Steady response time despite utilization of the system
Performance and Scalability are very important as they translate into lower cost per transaction
What do they mean?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 64
Diagnosing performance problems
§ Response Time / CPU Usage – Non acceptable response time for a transaction
§ Deadlocks – Threads locking each other causing applications to “freeze”
§ Inadequate configuration – Incorrect sizing/configuration for the intended use
§ Memory Leaks – Allocated memory not released after use
Common performance issues in the middle tier
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 65
Diagnosing performance problems
§ Identify problem category § Make sure that
– User expectations are realistic – Hardware and infrastructure is adequate for the desired performance – Verify that no event triggered the new condition
§ Refer to the appendix section and apply the proper methodology for the problem category at hand
Common performance issues in the middle tier
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 66
Application Object Library for Java (AOL/J)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 67
Application Object Library for Java
§ Use http://hostname:port/OA_HTML/jsp/fnd/aolj_setup_test.jsp?dbid=<dbid>
Debugging and troubleshooting: Security context information
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 68
Application Object Library for Java
§ Use http://hostname:port/OA_HTML/jsp/fnd/AolJdbcPoolStatus.jsp
Debugging and troubleshooting: Leaked connections
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 69
Application Object Library for Java
§ Use http://hostname:port/OA_HTML/jsp/fnd/aoljtest.jsp
Debugging and troubleshooting: Aoljtest: Test connection
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 70
Application Object Library for Java
§ Use http://hostname:port/OA_HTML/jsp/fnd/aoljtest.jsp
Debugging and troubleshooting: Aoljtest: AOL/J Services
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 71
Application Object Library for Java
§ 454178.1 - Oracle Application Server Diagnostic Tools and Log Files in Applications Release 12
§ MOS ID 380490.1 - Oracle E-Business Suite R12 Configuration in a DMZ
§ MOS ID 278176.1 - DMZ Configuration with Oracle E-Business Suite 11i
§ MOS ID 278868.1 - Diagnosing and tuning AOL/J JDBC Pool in Oracle e-Business Suite 11i
§ MOS ID 11.1 - Demo It To Oracle
Additional Information
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 72
When reporting a problem to Support What information is really necessary?
• Check all relevant versions to the failing page in the “About this page” link and add it to the service request
• Remember to enable “FND: Diagnostics” profile option (at least, for a single user)
• Upload all relevant logs: • $INST_TOP/logs/*
• Patches recently applied • Any relevant information • Java exceptions: Full exception
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 73
Q&A Questions? Clarifications?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 74
Monday, 3:15 pm – 4:15 pm Oracle E-Business Suite: Planning Your Upgrade Moscone West - 2001A
Tuesday, 1:15pm – 2:15 pm Oracle E-Business Suite Tools and Technology Moscone West - 2001A
Meet the Experts
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 75
Oracle Demos
Moscone West End-to-End Management of Oracle E-Business Suite W-063
SOA-Based Integration for Oracle E-Business Suite W-064
New User Productivity Capabilities in Oracle E-Business Suite W-065
Oracle E-Business Suite 12.1 Technical Upgrade Best Practices W-066
Advanced Architecture and Technology Stack for Oracle E-Business Suite W-067
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 76
Related Sessions
Monday
10:45 am CON9024 - Oracle E-Business Suite Technology: Latest Features and Roadmap Lisa Parekh
Moscone West 2016
3:15 pm CON9021 - Oracle E-Business Suite Future Directions: Deployment and System Administration Max Arderius
Moscone West 2016
4:45 pm CON9017 - Desktop Integration in Oracle E-Business Suite 12.1 Padmaprabodh Ambale, Gustavo Jimenez
Moscone West 2016
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 77
Related Sessions
Tuesday
10:15 am CON9023 - Oracle E-Business Suite Technology Certification Primer and Roadmap Steven Chan
Moscone West 2016
11:45 am CON9028 - Minimizing Oracle E-Business Suite Maintenance Downtimes Santiago Bastidas, Elke Phelps
Moscone West 2016
11:45 am CON9116 - Extending the Use of Oracle E-Business Suite with the Oracle Endeca Platform Osama Elkady, Muhannad Obeidat
Moscone West 2018
1:15 pm CON9005 - Oracle E-Business Suite Integration Best Practices Veshaal Singh, Oracle, Jeffrey Hand, Zebra Technologies
Moscone West 2018
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 78
Related Sessions
Tuesday
1:15 pm CON9026 - Latest Oracle E-Business Suite 12.1 User Interface and Usability Enhancements Padmaprabodh Ambale
Moscone West 2016
5:00 pm CON8805 - Planning Your Oracle E-Business Suite Upgrade from 11i to Release 12.1 and Beyond Anne Carlson
Moscone West 3002/3004
5:00 pm CON9053 - Advanced Management of Oracle E-Business Suite with Oracle Enterprise Manager Angelo Rosado
Moscone West 2016
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 79
Related Sessions
Wednesday
10:15 am CON8809 - Oracle E-Business Suite 12.1 Upgrade Best Practices: Technical Insight Isam Alyousfi, Udayan Parvate
Moscone West 3011
10:15 am CON9032 - Upgrading Your Customizations of Oracle E-Business Suite 12.1 Sara Woodhull
Moscone West 2016
10:15 am CON9259 - Oracle E-Business Suite Internationalization and Multilingual Features Maher Al-Nubani
Moscone West 2018
11:45 am CON9029 - Oracle E-Business Suite Directions: Slashing Downtimes with Online Patching Kevin Hudson
Moscone West 2016
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 80
Related Sessions
Wednesday
1:15 pm CON9027 - Personalize and Extend Oracle E-Business Suite Applications with Rich Mashups Gustavo Jimenez, Padmaprabodh Ambale
Moscone West 2016
3:30 pm CON9036 - Advanced Oracle E-Business Suite Architectures: Maximum Availability, Security, and More Elke Phelps
Moscone West 2016
5:00 pm CON9047 - Efficiently Scaling Oracle E-Business Suite on Oracle Exadata and Oracle Exalogic Isam Alyousfi, Nishit Rao
Moscone West 2016
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 81
Related Sessions
Thursday
11:15 am CON8716 - Web Services and SOA Integration Options for Oracle E-Business Suite Rekha Ayothi, Veshaal Singh
Moscone West 2016
11:15 am CON9030 - Recommendations for Oracle E-Business Suite Performance Tuning Isam Alyousfi, Samer Barakat
Moscone West 2018
11:15 am CON3429 - Using Oracle ADF with Oracle E-Business Suite: The Full Integration View Siva Puthurkattil, Juan Camilo Ruiz, Sara Woodhull
Moscone West 3003
12:45 pm CON9020 - Integrating Oracle E-Business Suite with Oracle Identity Management Solutions Sunil Ghosh, Elke Phelps
Moscone West 2016
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 82
Related Sessions
Thursday
2:15 pm CON9019 - Troubleshooting, Diagnosing, and Optimizing Oracle E-Business Suite Technology Gustavo Jimenez
Moscone West 2016
2:15 pm CON9031 - The Top 10 Things You Can Do to Secure Your Oracle E-Business Suite Instance Eric Bing, Erik Graversen
Moscone West 2018
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 83
Appendix Concurrent manager diagnostic tools J2EE Container performance
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 84
Concurrent Processing
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 85
Concurrent processing
§ Turn on Statement level logging § OAM -> Concurrent Managers -> Output Post Processor § Set Log level to Statement § Can be done as needed
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 86
Concurrent processing
§ Sending commands to the service – Commands can be sent to the service using the procedure – FND_CP_OPP_IPC.SEND_COMMAND
procedure send_command ( recipient in Varchar2, sender in Varchar2, command in Varchar2, parameters in Varchar2)
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 87
Concurrent processing
§ Parameters – recipent = concurrent_process_id of OPP service instance – sender can be anything, such as "sqlplus“ – command is [package].[class name] of the OPP*Command.class (w/o
class extension) – parameters = varchar string containing any parameters for the – OPP*Command's execution
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 88
Concurrent processing
§ Existing commands are: – OPPDumpPoolStatsCommand – OPPListThreadsCommand – OPPMemoryUsageCommand – OPPPingCommand – OPPQueryRequestCommand – OPPSetDebugCommand – OPPShowPropertiesCommand – OPPTerminateCommand
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 89
Concurrent processing
§ All of these commands are in the package oracle.apps.fnd.cp.opp
§ Example:
– exec fnd_cp_opp_ipc.send_command(<cpid>, 'sqlplus', 'oracle.apps.fnd.cp.opp.OPPSetDebugCommand', '1');
§ Where <cpid> is the concurrent process id of the service.
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 90
Concurrent processing
§ Allows for custom commands: § Your Java class should implement
oracle.apps.fnd.cp.opp.OPPCommand, and implement the method public void execute(). The execute method will be called when the command is received.
§ You can access the parameters using the String field "params", and you can write to the OPP logfile using CPLog.log().
§ Use your class name in the call to send_command and your code will be executed, even without bouncing the service.
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 91
Concurrent processing
§ In 12.2, and in 12.1.3 after applying patch 13019389, the status information that was previously only found in the OPP logfile will be transferred to the concurrent request log. This applies to publishing, delivery and bursting actions.
§ Note that some actions are asynchronous, and may still be running when the request completes, so the status may not show up in the log. There is a new window in the SRS form that will show all post-processing actions and their status. It can be accessed by querying a request, selecting the Diagnostics button, and then the Post Processing Results button.
OPP (Output Post Processor) Service
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 92
Concurrent processing
§ Step 1: Edit the listener.ora file as follows: – Append the following variables to the "envs" value for FNDFS in the
listener.ora file: FNDFS_LOGGING=ON,FNDFS_LOGFILE=<filename> where <filename> is the fully qualified filename where FNDFS should log it's messages
§ Note: This should be done for the Apps listener on each CP node.
FNDFS Diagnostics and troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 93
Concurrent processing
§ Step 2: Bounce the listener.
§ At this point, you can attempt to view a log or out file using FNDWRR and there should be a logfile created with the name specified by FNDFS_LOGFILE in the listener.ora. This log will only show the activity of FNDFS. It does not log the activity of FNDWRR.exe.
§ To see the activity of both FNDFS and FNDWRR.exe, proceed with next steps
FNDFS Diagnostics and troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 94
Concurrent processing
§ Step 3: Run the concurrent program FS Diagnostic Test Program. § To run the full suite of tests, pass parameters as follows:
– Mode = FULL – Filename = <fully qualified path and filename of some file on a CP node of
this environment> – Nodename= <the node on which filename specified is located> – Request ID=<the request id of some request with an out file. – Manager ID = <the concurrent_process_id of some manager process>
FNDFS Diagnostics and troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 95
Concurrent processing
§ The program will call FND_WEBFILE.set_debug, which will enable logging for FNDWRR.exe. The program tests file transfer for the filename given, for the outfile of the request id given, and for the logfile of the manager id given. The results of each test will be printed in the out file. The log filename for FNDFS and for FNDWRR.exe will also be documented in the request out file.
FNDFS Diagnostics and troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 96
Concurrent processing
§ Setup checklist for FND_FILE issues: – Check the value of the environment variable $APPLPTMP that the
managers are using – Check the value the managers are actually using, don't just echo the value
at the command line. This can be done by checking /proc/<pid>/environ, checking the FND_ENV_CONTEXT table, or running the "Print Environment Variable" concurrent request. This should apply to checking any environment variable anytime.
– $APPLPTMP refers to a directory. This directory is located on the DATABASE server, not the middle tier.
FND_FILE Diagnostics and troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 97
Concurrent processing
§ This directory must be listed as the *first* value of the utl_file_dir initialization parameter.
§ This directory must be readable/writable by the user that owns the database. This may or may not be the same user that owns the middle tier.
§ If you are using RAC, you must SHARE this directory across all RAC nodes. Again, the $APPLPTMP directory must be shared in the same location on every RAC node.
FND_FILE Diagnostics and troubleshooting
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 98
Concurrent processing
§ When faced with issues related to the CRM, such as trying to determine whether incompatibilities are working or not, you can tell the CRM to turn on very detailed logging.
§ This log will specify each request in detail and whether it will be released to run or not, and the reason why or why not.
Conflict Resolution Manager
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 99
Concurrent processing
§ Example log fragment:
25-MAY-1999 11:05:48 : Request read start 25-MAY-1999 11:05:48 : Requests read 1 2031538: st Q ip 4 sthrd N uid 8686 raflag N mgr 1 iprog go sysdt 2451324.39948 tstmp 2451324.39948 diff 0 th 0 st I 25-MAY-1999 11:05:48 : Request write start 25-MAY-1999 11:05:48 : Requests written 1
Conflict Resolution Manager
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 100
Concurrent processing
§ CRM logging can be turned on by running the query below:
update fnd_concurrent_queues set diagnostic_level = '?' where concurrent_queue_id = 4;
Conflict Resolution Manager
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 101
Concurrent processing
§ Oracle Applications Manager has a Transaction Manager wizard that allows you to verify the generic functionality. It does this by starting up a test transaction manager and running a test transaction. If this transaction is successful, then the generic functionality provided by ATG is working, and the problem is likely with a specific module transaction. If this transaction fails, then likely no other transactions will be working on the system.
§ This wizard also allows you to see timing results for the transaction, so it maybe helpful when diagnosing transaction performance issues.
Transaction Managers
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 102
Concurrent processing
§ It is recommended that this step be always run first, and then if problems still exist with specific transactions, the instructions in the next step can be followed.
§ To run the wizard, log in to OAM and select 'Transaction Managers' under 'Application Services' from the Site Map. Next, select the 'Time Transaction' button, then the 'Run Test' button.
§ The test will be run and the results displayed. Note that it may take a few minutes if the test transaction manager is not already running.
Transaction Managers
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 103
Concurrent processing
§ The wizard can also be used to enable debugging for the transaction managers. Use the 'Set Debug Level' button of the wizard.
§ If problems are being encountered only for a specific transaction then the following steps should be followed:
– Shutdown the managers – Set Profile Option Concurrent:Debug Flags to 'TCTM1‘ – Truncate the FND_CONCURRENT_DEBUG_INFO table – Start managers back up with DIAG=Y – Run the transaction
Transaction Managers
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 104
Concurrent processing
§ The following sources of information should now be available: – The Transaction Manager logfile – Debug information from the FND_CONCURRENT_DEBUG_INFO table
§ Both of these will be needed for any transaction manager issue. § When the managers are started with diag=Y, the transaction managers
will write extra debugging information to their logfiles § When the profile option Concurrent:Debug Flags is set, debug
information will be written to the FND_CONCURRENT_DEBUG_INFO table.
Transaction Managers
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 105
Concurrent processing
§ You can select this data after the transaction is run using: select to_char(time, 'DD-MON-RR HH24:MI:SS') timestamp, action, function, message from fnd_concurrent_debug_info order by time_in_number;
§ IMPORTANT: order by TIME_IN_NUMBER, otherwise you will not see the statements in order, and the data will be difficult to decipher.
§ Best to run a single transaction at a time for debugging, making reading easier. If cannot avoid multiple transactions being run, then you can also add SESSION_ID to the above select statement so you can tell the sessions apart.
Transaction Managers
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 106
Concurrent processing
§ Concurrent: Force Local Output File Mode – If you have shared your $APPLCSF directory across all your CP nodes,
you can set this profile option to Yes. This notifies the managers that the same $APPLCSF directory is available on all nodes and thus any log file or output file is available locally without having to resort to transferring the file across the network. This can result in reduced network traffic and improved performance.
Miscelaneous
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 107
J2EE container performance optimization in detail
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 108
Response Time/CPU Issues/Deadlocks
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 109
Response Time/CPU Issues § Configure Apache to log the time it takes to service a request by
editing httpd.conf and adding the %T option – For 11.5, edit $IAS_ORACLE_HOME/Apache/Apache/conf/httpd.conf – For R12, edit $ORA_CONFIG_HOME/10.1.3/Apache/Apache/conf/
httpd.conf § The access log will contain the response time information
– For 11.5: $IAS_ORACLE_HOME/Apache/Apache/logs/access_log* – For R12: $LOG_HOME/ora/10.1.3/Apache/access_log*
LogFormat "%{ClientIP}i %l %u %t [ecid: %{Oracle-ECID}i] \"%r\" %>s %b [%T (secs)]" common
** T% allows for response time and ECID allows you to trace the OC4J request and see if it is a failure or success. MOS Note.266662.1
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 110
Response Time/CPU Issues § Access log output example: 148.87.19.51 1 - - [01/May/2007:11:38:49 -0700] "GET /OA_HTML/AppsLocalLogin.jsp HTTP/1.1" 200 5986
148.87.19.51 0 - - [01/May/2007:11:38:53 -0700] "POST /OA_HTML/fndvald.jsp HTTP/1.1" 302 259
148.87.19.51 5 - - [01/May/2007:11:38:58 -0700] "GET /OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE HTTP/1.1" 200 41609
148.87.19.51 5 - - [01/May/2007:11:39:15 -0700] "GET /OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE&akRegionApplicationId=0&navRespId=20420&navRespAppId=1&navSecGrpId=0&transactionid=36910577&oapc=2 HTTP/1.1" 200 94506
§ The second field is the response time in second (%T was added as the second field in the previous examples)
§ Note: the entry is written when the request is complete, so if it is hanging, you will not find an entry
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 111
Response Time/CPU Issues
§ Rule out SQL issues. See Note 357597.1 on enabling SQL trace for OA Framework applications
§ Move onto JVM issues – Collect thread dumps – Analyze GC logs – Use Profilers – Record, Analyze and View Heap Dumps
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 112
Thread dumps and Deadlocks
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 113
Thread Dumps
§ A Thread Dump shows the stack of each thread in the JVM § Identify expensive methods via series of Thread Dumps § Shows blocked/deadlocked threads § UNIX, issue kill –QUIT <jvm pid> § For JDK 1.5 or above, you can also try jstack <pid>. § For PIDs:
– $INST_TOP/admin/scripts/adopmnctl.sh status
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 114
Thread dumps
§ System Property CLIENT_PROCESSID in “About this page” § The thread dump will be written to the stdout file
– 11i: § $IAS_ORACLE_HOME/Apache/Jserv/logs/jvm/OACoreGroup.*.stdout
– R12: § $LOG_HOME/ora/10.1.3/opmn/OC4J~oacore~default_group_*
§ Users ends on same JVM after initial log in
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 115
Thread Dumps
"Thread-32361" daemon prio=1 tid=0x90787f40 nid=0x542e runnable [0x91e4f000..0x91e5086c]
at java.net.SocketInputStream.socketRead(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:85) . . . "Thread-27325" daemon prio=1 tid=0x87cfa08 nid=0x4313 waiting on monitor [0x90dff000..0x90dff86c]
at java.lang.Thread.sleep(Native Method) at oracle.apps.jtf.base.session.Monitor.run(Monitor.java:50) . . . "Thread-12" daemon prio=1 tid=0x8099058 nid=0x595c waiting on monitor [0x8f1ff000..0x8f1ff86c]
at java.lang.Object.wait(Native Method) at oracle.apps.fnd.common.Pool.run(Pool.java:1873) at java.lang.Thread.run(Thread.java:479) . . .
Full thread dump
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 116
"Thread-167473" daemon prio=10 tid=000b8f70 nid=171653 lwp_id=7886850 runnable [0x37eff000..0x37efe4f0] at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:134) . . . at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:656) - locked <46f6ca40> (a oracle.jdbc.driver.OracleCallableStatement) - locked <46d64270> (a oracle.jdbc.driver.OracleConnection) . . . "Thread-1" daemon prio=10 tid=000b6000 nid=14 lwp_id=2015294 waiting for monitor entry [0x39a77000..0x39a764f0] at oracle.jdbc.driver.OracleConnection.isClosed(OracleConnection.java:1554) - waiting to lock <46d64270> (a oracle.jdbc.driver.OracleConnection) at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:2260)
Thread Dumps Thread dump showing a live lock wait:
This is the thread waiting for the same lock
This is the thread holding the lock with address 46d64270
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 117
Deadlocks
§ Deadlocks can cause the application/process to hang § System instability can result from cleanup thread or monitor thread
deadlocks § Deadlocks can be seen in the thread dumps
What are they? What do they do?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 118
Deadlocks
Found one Java-level deadlock:
==============================
"Thread-3687": waiting to lock monitor 0x08097d74 (object 0x50973e58, a oracle.apps.fnd.framework.server.OADBTransactionImpl),
which is held by "Thread-3579"
"Thread-3579": waiting to lock monitor 0x08097dac (object 0x50972a40, a oracle.jbo.JboSyncLock),
which is held by "Thread-3687"
Deadlock example in a Sun JVM Thread Dump
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 119
Deadlocks w/ Visual VM
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 120
Out of memory errors / Memory leaks
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 121
JVM Heap Management
§ Objects are allocated from the Java heap, and are garbage collected when there are no more strong references to them
§ Java heap is divided into multiple generations (memory pools). Each pool holds objects of a certain age
§ Eden – newly created objects § Survivor – short to medium-lived objects § Tenured (Old) – long-lived objects § Permanent – class files
A typical Java program creates objects
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 122
Garbage Collection
§ New objects are allocated from Eden § Eden full à minor collection (Partial GC). § Objects still strongly referenced moved to the survivor space § Objects in survivor space “old” enough, moved to old generation. § Old generation full à major collection (Full GC).
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 123
Monitor JVM Garbage Collection § –verbose:gc option à monitors JVM GC and heap usage
– Autoconfig adds this option § Review log files
– steadily increasing heap à possible memory leak. – 11i:
§ $IAS_ORACLE_HOME/Apache/Jserv/logs/jvm/OACoreGroup.*.stdout – R12:
§ $LOG_HOME/ora/10.1.3/opmn/OC4J~oacore~default_group_* – JDK 1.5.0_08 à Timestamp relative to JVM startup – Prior versions à Relative to first GC event
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 124
Monitor JVM Garbage Collection Sample output for Sun’s JVM:
0.000: [GC 143357K->34512K(514048K), 1.5519252 secs]
103.925: [GC 177872K->44238K(514048K), 0.7564096 secs]
124.894: [GC 187598K->51968K(514048K), 0.5778231 secs]
687.205: [Full GC 366626K->230896K(514048K), 7.3117923 secs]
Minor GC is usually fast
Full GC is much slower
Heap Usage before GC
Heap Usage after GC
Current Heap Capacity
Time taken for GC GC begin time
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 125
Monitor JVM Garbage Collection § Use –XX:+PrintGCDetails for more information about generations at
GC: 6.037: [Full GC [PSYoungGen: 1718K->0K(12480K)] [PSOldGen: 3488K->5178K(113856K)] 5207K->5178K(126336K) [PSPermGen: 10241K->10241K(20736K)], 0.0691040 secs]
9.187: [GC [PSYoungGen: 423K->80K(12480K)] 5602K->5258K(126336K), 0.0011820 secs]
9.188: [Full GC [PSYoungGen: 80K->0K(12480K)] [PSOldGen: 5178K->5179K(113856K)] 5258K->5179K(126336K) [PSPermGen: 10242K->10242K(23296K)], 0.0629940 secs]
§ jstat (JDK 1.5 onwards) to monitor GC
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 126
OutOfMemoryError
§ OutOfMemoryError à JVM unable to free up memory after GC – Request to create a new object could fail with an OOME – A request to load a class could fail with OOME
§ Not enough space in the permanent generation § Probably cause: many modules in use with limited number of JVMs
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 127
OutOfMemoryError
§ OOME occurs à Error message depends on JDK version – JDK 1.4.2 à no details:
java.lang.OutOfMemoryError
– JDK 1.5 à tells you which heap area but no give stack trace java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: PermGen space
– JDK 1.6 à heap area + stack trace Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at Test.main(Test.java:10)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 128
OutOfMemoryError
§ The error message could appear in a variety of places – On the browser window – In FND_LOG_MESSAGES – 11i
§ In $IAS_ORACLE_HOME/Apache/Jserv/logs/jvm/OACoreGroup.*.stderr
– R12 § In $LOG_HOME/ora/10.1.3/opmn/oacore_default_group_*/
oacorestd.err
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 129
Jconsole Diagnosis of OOME
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 130
Collecting OutOfMemoryError Information § Error Logs
– Tell you which kind of OOME – Shows you the place where OOME occurs (JDK 1.6)
§ GC Logs – Allows you to see memory growth trend over time – The trend can be used to determine general cause of OOM
§ Useful to provide to support when logging service request
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 131
OutOfMemoryError log file contents… § This will be present in the $LOG_HOME/ora/10.1.3/opmn/
default_group~oacore~default_group~1.log
10063.579: [Full GC 118783K->118783K(124928K), 1.2299950 secs] 10064.810: [Full GC 118783K->117911K(124928K), 1.3957510 secs] 10066.269: [Full GC 118783K->118783K(124928K), 1.2217780 secs] 10067.492: [Full GC 118783K->118783K(124928K), 1.2127460 secs] 10068.706: [Full GC 118783K->118783K(124928K), 1.2166770 secs] 10069.924: [Full GC 118783K->117977K(124928K), 1.2416330 secs] java.lang.OutOfMemoryError: GC overhead limit exceeded Dumping heap to java_pid8515.hprof ... Heap dump file created [149076109 bytes in 10.240 secs]
§ Heap Location is here: -bash-3.2$ cd $INST_TOP/../../../apps/tech_st/10.1.3/j2ee/home -bash-3.2$ ls -l *hprof -rw------- 1 oraperf dba 149076109 Jan 26 11:11 java_pid8515.hprof -bash-3.2$
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 132
Collecting OutOfMemoryError Information
§ Class Histogram over a period of time – Add -XX:+PrintClassHistogram switch and send kill –QUIT signals to JVM – Shows memory utilization by instances of each class – Helps in conjunction with heap dumps by trending memory usage of each class
§ Heap Dump – Provides the most information – Allows you to see what objects are in the heap and the reference graph. – Reference graph tells you why the object remains in the heap – Due to their large size, ask the customer to compress the heap. This will speed up
analysis and problem resolution – Also do notice that once you take the heap dump that the objects cleaned may need
to be recreated.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 133
Getting Heap Dumps – Sun JVM § Sun JDK 1.5 and JDK 1.6 have options to dump the JVM heap
– Add –XX:+HeapDumpOnOutOfMemoryError –XX:HeapDumpPath=/tmp to the JVM options in opmn.xml enabled oacore section.
– If there is an OutOfMemoryError, the contents of the heap will be dumped to a file in the directory specified by –XX:HeapDumpPath
– The heap dump file can be read by the Heap Analysis Tool (HAT), or jhat (in JDK 6), or one that supports the binary heap dump format (e.g. Eclipse Memory Analyzer Tool)
– Enhancements on 1.6 to dump heap on signal: See Jconsole documentation.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 134
OutOfMemoryError causes § Common causes of OOME
– Memory Leak – Some objects not cleaned up after an operation, or incorrect cache management
– Memory Hemorrhage - Infinite loops or consuming vast amounts of memory by reading large data sets
– Blocking – Deadlock/Blocking of cleanup threads preventing normal cleanup operations
– Sizing Issues – Heap is undersized for expected load
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 135
EBS Sizing Recommendations
§ Metalink note#: 362851.1 § JVM NewRatio = 2 § Xmx=Xms § Xmx=Xms=1024mb to start with. § Load testing à Key.
– This would ensure that the projected # of users are able to have a pleasant time using the system\
§ Autoconfig takes care of the recommended values
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 136
Identifying Memory Leaks
§ Symptoms: – Heap usage increases steadily over a relative longer period of time
(e.g. several hours or days) – When memory leak is large enough à continuous Full GC – Different users may encounter OOM on totally unrelated flows
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 137
Identifying Memory Leaks
§ Find the source of the memory leak (Important) – Get a heap dump when the OOME occurs – Get series of class histograms over time and observe what classes
are growing § -XX:+PrintClassHistogram. The + enables the option, the –
disables it. Add to the opmn.xml enabled oacore section. – If possible, get a series of heap dumps and observe what classes
are growing – Get a series of thread dumps and see if there are any cleanup
threads that are deadlocked/blocked
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 138
Connection and JDBC Statement Leaks
§ Prior to 11.5.10, memory leaks are also frequently caused by JDBC statement/connection leaks.
§ In 11.5.10 and R12, these have been decreased by having GSCC checks and more monitoring during system test
§ Prior to R12, you can use AoljDbcPoolStatus.jsp or OAM to monitor connection leak
§ In R12, you also need to monitor the stdout/stderr logs for connection leaks
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 139
Connection and JDBC Statement Leaks
• Use <host>:<port>/OA_HTML/jsp/fnd/AoljDbcPoolStatus.jsp • Need to login as user with FND:Diagnostics profile set to Yes.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 140
Identifying Memory Hemorrhage
§ Symptoms of memory hemorrhage – Free heap after GC decreases rapidly, over a short period of time (e.g.
serveral seconds or minutes) – Continuous Full GC in the GC log – The OOME is reproducible. A particular flow will always trigger the OOME
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 141
Identifying Memory Hemorrhage
§ Finding the source – Flow causing the OOME – StackOverflowError à infinite loops: Take thread dumps regularly and look
for very deep stacks. – Get heap dump at OOME occurrence
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 142
Java Diagnostic Tools / Methods / Usage
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 143
Tools for Diagnosing Heap Dumps
§ Regardless the tool, always…
– Look for classes/dominators occupying most of the heap – Look for reference path to the root to determine why the instances
remain in memory – Discuss with appropriate support team.
§ Performance
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 144
Tools for Viewing Heap Dumps § Oracle’s JHat bundled with JDK 1.6.0
– Primitive UI – Slow
§ Visual VM Java Profiler – Similar to Jconsole + profiling. Colorful output and graphs
§ Eclipse Memory Analyzer – Faster heap analysis, able to process large heap dumps
§ Use 64bit for heaps larger than 2GB § IBM – IBM Heap Analyzer
– http://www.alphaworks.ibm.com/tech/heapanalyzer § Oracle AD4J
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 145
Jconsole Diagnostic Tool
§ Provided by Oracle with JDKs (version 5/6). § Visual reporting of resources in use of a running JVM § JDK6 onwards à ad-hoc, on demand heap dumps
– Huge improvement of JDK5 non-cooperative mechanism § Visual instrumentation for memory segments and how are they
doing
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 146
Jconsole remote diagnostics
§ Using JMX (Java Management Extensions) § Remote monitoring: Add the following to opmn.xml).
– -Dcom.sun.management.jmxremote.authenticate=false – -Dcom.sun.management.jmxremote.ssl=false – -Dcom.sun.management.jmxremote.port=4000 – Not managed by autoconfig
§ For more options please see JMX documentation at OTN
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 147
Jconsole Diagnostic Tool Overall
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 148
Jconsole Diagnostic Tool Memory tab
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 149
Jconsole Ad-hoc heap dumps
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 150
MAT – Eclipse Memory Analyzer Tool Use to analyze heap dumps
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 151
Fiddler2 Analyze HTTP traffic
• See http://www.fiddler2.com/ for instructions
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 152
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 153