java_heap_sz - Maximum Java interpreter heap size configuration parameter

You can use this parameter to determine the maximum size of the heap that is used by the Java™ interpreter started to service Java Db2® stored procedures and UDFs.

Configuration type
Database manager
Applies to
  • Database server with local and remote clients
  • Client
  • Database server with local clients
  • Partitioned database server with local and remote clients
Parameter type
Default [range]
65 536 [0 - 4 194 304]

When the value is more than 2 GB, the JVM starts with the -Xnocompressedrefs option set automatically.

Unit of measure
Pages (4 KB)
When allocated
When a Java stored procedure or UDF starts
When freed
When the db2fmp process (fenced) or the db2agent process (trusted) terminates.

There is one heap per db2fmp process running a Java stored procedure. For multithreaded db2fmp processes, multiple applications using threadsafe fenced routines are serviced from a single heap. In all situations, only the processes that run Java UDFs or stored procedures ever allocate this memory. On partitioned database systems, the same value is used at each database partition.

XML data is materialized when passed to stored procedures as IN, OUT, or INOUT parameters. When you are using Java stored procedures, the heap size might need to be increased based on the quantity and size of XML arguments, and the number of external stored procedures that are being executed concurrently.