IBM Books

UDF Shared Memory Set Size (udf_mem_sz)

Configuration Type
Database manager

Applies to

Parameter Type
Configurable

Default [Range]
256 [ 128 - 60 000 ]

Unit of Measure
Pages (4KB)

When Allocated
When a UDF starts

When Freed
When a UDF completes

This parameter is common to both fenced and unfenced User Defined Functions (UDFs). For a fenced UDF, it specifies the default allocation for memory to be shared between the database process and the UDF. In a non-partitioned database environment, there is only one shared memory set. In a partitioned database environment, there is a shared memory set for each database partition server, and all application agents and sub-agents running on that server use the same shared memory set.

For an unfenced UDF it specifies the size of the private memory set. In a non-partitioned database environment, the heap is allocated from private memory. In a partitioned database environment, the heap is allocated from the Application Controlled Shared memory for each node, and all application agents and subagents running on that node use the same shared memory set.

For both fenced and unfenced UDFs, this memory is used to pass data to a UDF and back to a database.

If no UDFs are used in applications, the memory is not allocated. If both fenced and unfenced UDFs are running in the same application, two memory allocations result: one for fenced UDFs, and one for unfenced UDFs.

For more information about user-defined functions, see the Embedded SQL Programming Guide and the SQL Reference.

Recommendation: The default setting should be adequate for all cases not involving the passing of LOB data to a UDF. For cases which pass LOB data to a UDF, you may need to increase the amount of memory allocated. You should set the value of this parameter at least 2 pages larger than the size of the input arguments and the result of the external function.
Note:The memory requirement for UDFs tends to be additive, so the number of UDFs referenced in an application affects the size of the default to be set for this configuration parameter.

[ Top of Page | Table of Contents | Glossary | Index ]

[ DB2 List of Books | Search the DB2 Books ]