Title: OCCI Oracle C Call Interface
1OCCIOracle C Call Interface
- Krzysztof Nienartowicz
- DB Workshop
- January 29-31, 2002
2Overview
- Architectural overview
- Occi typical usage, development cycle
- Issues to solve, problems
- Tools, techniques used to understand OCCI
internals
3General Architecture overview
- Associative ODMG like access using Refltgt
- OCCI is a wrapper on top of OCI and Oracle
internal calls - Set of C base classes, utility classes
- templates
- binary libraries
4Architectural overview. cont.
- OCCI is composed of 25 classes 30 classes of
Oracle Data Cartridge Interface (ODCI)
definitions for schema handling - Refltgt access and root PObject classes act as a
interface with hidden implementation delegated to
RefImpl and PObject binary packaged - plus utility classes to handle oracle native
types - Connections, db environment
5Architectural overview. cont.
- innerNode as a user type. N1,..,N10 are private
innerNode_C members - Access via get, set or as a public ones, OTT
dependent
6Architecture overview, cont. 2
- STL dependencies
- Binary and string types represented as STL
stdvectors and stdstrings - May hit the performance if a conversion (due to
type casting) is done under the hood - No difference between const and non-const access
patterns
7Typical, application flow
8OCCI Development cycle
- DDL driven, one must have DB schema defined first
- Two main cycles with given approach
- Schema definition, schema tuning phase
- Standard 3gl object oriented methodologies for
the latter phase
9OCCI Development cycle, 2
- Schema definition - DDL/SQL
10OCCI Development cycle, 3
11OCCI Development cycle, 4
12Occi current problems, issues, tweaks
- Oracle production/bug fix cycle dependency
- Ball on the Oracle side
- Small leaks escalation, cache settings dependent
- Refltgt const, internal memory initialisation
problems - Prefetching problems
- Users responsibility to delete embedded objects
- Unnamed exceptions thrown sometimes, segmentation
faults instead of exceptions occur
13Bloating memory (cache?) problem
- Memory consumption of a trivial, very small
object linked list iteration - Appears for many accesses for certain cache
settings - Memory growth is access related not accessed
objects size related - Benchmarking consequences
14Occi memory problems detection
- Unistd.h sbrk(0) very helpful
- mpatrol package
- Mpatrol, mptrace, mprof
- Dynamic hooks to the OS (libc, stdc) memory
calls with no code changes, recompilation on UX - Sophisticated memory monitoring, profiling with
logging and post mortem analysis
15Mpatrol usage
- Memory graphical profiling with mprof
- Visual tracing with mptrace
- Textual form, calls graph
- Memory leaks, resizing, deleting, allocating
stats
16mpatrol
- Easier tracing down of inefficiencies, in example
beneath, extracted dereferencing of the app
object.
17Other mpatrol benefits
MEMSET memset (0x002240C8, 68 bytes, 0x00)
--- 0xFEE72F34 kghualloc600 0xFED0B20C
kohalmc480 0xFED0B020 kohalc1836 0xFEA0D63C
kadlal80 0xFEDACFC8 kopldsgen40 0xFEA15DB0
kadgscval228 0xFEA15614 kadattrget4396 0xFE9A3
9C0 OCIAnyDataAttrGet68 0x000A14A0
oracleocciNumber occiAnyDataImplgetNumber(
)const104 0x00064E58 void innerNode_CreadSQL(o
racleocciAnyData)32 0x00064D20
voidinnerNode_CreadSQL(void)192 0xFECF3750
kodpunp3700 0xFED02794 kocdsun460 0xFECF6F7C
kocgpn22720 0xFECF64D4 kocgpn80 0xFED32B48
OCIObjectPin3872 0x00088F94 oracleocciPObjec
toracleocciRefImplpin()168 0x0005F204
innerNodeoracleocciRefltinnerNodegtoperator-gt
()44 0x0005C37C long BenchAppltlonggtCheckInnerC
ycle()212 0x000578D0 void BenchAppltlonggtDoRea
d()720 0x0005738C int BenchAppltlonggtRun()52
0x0005F78C main92
- Occi internals quasidebugging, i.e. allows to
understand occi-oci-oracle layering better
18Summary
- The Refltgt associative access the main OCCI
advantage in comparison to other methods - Waiting for the next release to proceed with
benchmarks - Cache handling improvement
- Bugs to be removed
- Inconsistencies to be removed (i.e. ott naming)
- For mpatrol check http//www.cbmamiga.demon.co.uk
/mpatrol