Sizing and Configuring the JAVA_POOL_SIZE
-----------------------------------------
The shared parts of each Java class are stored in the Java pool. This includes
read-only memory, such as methods. The init.ora parameter JAVA_POOL_SIZE
controls the size of the Java pool which defaults to 20 MB.
Java pool is consumed primarily during class loading, although compilation and
resolution also consume Java pool memory. The more Java classes and code that
is actually in use in your database instance, the more Java pool is required.
There is no incremental per-session cost for the Java pool. The per class
memory requirement can average about 4-8 KB for each class. On a dedicated
server only using Java stored procedures, it is possible that the
JAVA_POOL_SIZE could be as low as 10 MB.
None of the per session Java states are stored in the Java pool. For dedicated
servers, it is stored in the UGA within the PGA. Under Multi-Threaded Server
(MTS), which is required for CORBA and EJBs, the Java pool could be very large.
CORBA and EJBs require more memory, large Java-intensive applications could
require up to one GB of Java pool memory.
In MTS servers, some of the UGA used for per session Java states are stored in
the Java pool. Since the Java pool is fixed in size, you must estimate the
total requirement for your applications and multiply by the number of
concurrent sessions they want to create. All UGAs must be able to fit in the
Java pool.
As a general guideline, the JAVA_POOL_SIZE should be set to 50 MB or higher for
large applications. The default of 20 MB should be adequate for typical Java
stored procedure usage.
To determine how much Java pool memory is being used, query V$SGASTAT:
SELECT *
FROM V$SGASTAT
WHERE pool = 'java pool';
Add free memory to memory in use to determine the size of the Java pool.
Partager