Manage shared memory
- C UDRs
A C UDR has access to the following types of shared memory for dynamic allocations: user memory and named memory.
- DataBlade®
API constructor
functions
A constructor function allocates its DataBlade® API data type structure in user memory. The constructor can allocate a particular data type structure with a specified memory duration (DataBlade API data type structures with a PER_ROUTINE memory duration through DataBlade API data type structures with a PER_STMT_EXEC memory duration) or the current memory duration (DataBlade API data type structures with a PER_SESSION memory duration).
Type of shared memory | Description | DataBlade® API functions |
---|---|---|
User memory | Memory that is accessible by its address only. User memory can be allocated in the current memory duration or have a specified memory duration. | mi_alloc(), mi_dalloc(), mi_realloc(), mi_zalloc(), mi_switch_mem_duration(), mi_free() |
Named memory | Memory that has a name assigned and is accessible by its address or its name. Named memory has a specified memory duration. | mi_named_alloc(), mi_named_zalloc(), mi_named_get(), mi_named_free()
mi_lock_memory(), mi_try_lock_memory(), mi_unlock_memory() |
- These functions allocate the memory from shared memory so that all VPs can access it.
- The database server automatically reclaims memory allocated with
these functions.
These functions establish a memory duration for the memory they allocate. When this memory duration expires, the database server automatically marks the memory for reclamation. For more information, see Choose the memory duration.