The Java pool was added to support running Java in the database. If you code a stored procedure in Java, Oracle will use this chunk of memory when processing that code. The parameter JAVA_POOL_SIZE is used to fix the amount of memory allocated to the Java pool for all session-specific Java code and data.
The Java pool is used in different ways, depending on the mode in which the Oracle server is running. In dedicated server mode, the Java pool includes the shared part of each Java class, which is actually used per session.
These are basically the read-only parts (execution vectors, methods, etc.) and are about 4KB to 8KB per class. Thus, in dedicated server mode, the total memory required for the Java pool is quite modest and can be determined based on the number of Java classes you’ll be using.
Note that none of the per-session state is stored in the SGA in dedicated server mode, as this information is stored in the UGA, and, as you will recall, the UGA is included in the PGA in dedicated server mode.
When connecting to Oracle using a shared server connection, the Java pool includes both of the following:
•\ The shared part of each Java class.
•\ Some of the UGA used for per-session state of each session, which is allocated from the Java pool within the SGA. The remainder of the UGA will be located as usual in the shared pool, or if the large pool is configured, it will be located there instead.
If SGA_TARGET is set and the JAVA_POOL_SIZE is not set, then the default is zero (meaning it is internally determined by Oracle). If JAVA_POOL_SIZE is specified, then the value indicates a minimum value for the memory pool.
Streams Pool
The Streams pool is an SGA structure used by Oracle products that use the Streams pool. These include Oracle GoldenGate, XStream, Oracle Streams, Oracle Advanced Queuing, and Oracle Data Pump.
The size of the Streams pool is governed by setting the STREAMS_POOL_SIZE parameter. If SGA_TARGET is a nonzero value, then automatic SGA memory management will use the setting of STREAMS_POOL_SIZE as a minimum value for the Streams pool. If both the SGA_TARGET and STREAMS_POOL_SIZE are both set to zero, then up to ten percent of the shared pool is used by the Streams pool.
Products that use the Streams pool will buffer queue messages. Instead of using permanent disk-based queues, with their attendant overhead, these features use in-memory queues. If these queues fill up, they eventually spill over to disk. If the Oracle instance with the memory queue fails for some reason, due to an instance failure (software crash), power failure, or whatever, these in-memory queues are rebuilt from the redo logs.
The Streams pool is only important in systems using features (such as GoldenGate, Streams, and so on) that need space in this memory area. In those environments, the STREAMS_POOL_SIZE should be set in order to avoid “stealing” ten percent of the shared pool.