Question: What does the Java pool do
inside the Oracle SGA, and how di I sze the Java pool properly?
Answer: The java pool is a RAM region within the
Oracle SGA and the java pool RAM is used to provide:
- Parsing of Java code and scripts
- Installation tasks related to Java applications with Oracle
11g
- Java stored procedure code parsing
The JAVA Pool holds the JAVA execution code
in a similar manner to the PL/SQL cache in the shared pool. The
JAVA pool is used by many internal routines, such as import and
export, and should be sized at approximately 60 megabytes if no
other JAVA will be utilized in the user applications.
Tuning and sizing the Java pool
Like all Oracle pools, the Java Pool uses a least-recently-used
algorithm to ensure that the most "popular" Java stays pinned in
RAM. If the Java pool is undersized, Java performance may
degrade because of the need to re-claim RAM space which has been
aged out of the Java Pool.
With the Oracle JVM (Java Virtual Machine, you can guarantee that
Java stays in RAM by placing
Java in an Oracle stored procedure and pinning the package in
the SGA with dbms_shared_pool.keep. See
Pinning Packages Objects in the Shared Pool.
In order to tune the best size for the Java pool within Oracle, either the AMM feature can be deployed or manual tuning can
be conducted via the v$javapool and v$java_pool_advice dynamic
performance views as shown in the following example listings:
Name Null? Type
----------------------------------------- --------
----------------
CATEGORY VARCHAR2(16)
MEMUSED
NUMBER
SQL>
select * from v$javapool;
CATEGORY MEMUSED
---------------- ----------
8755260
select
estd_lc_size,
estd_lc_load_time_factor,
estd_lc_load_time,
java_pool_size_for_estimate,
java_pool_size_factor
from
v$java_pool_advice;