Home | Previous Page | Next Page   Appendix A. Writing a Client LIBMI Application > Managing Memory in Client LIBMI Applications >

Deallocating User Memory

The database server does not perform any automatic reclamation of user memory in a client LIBMI application. Therefore, the client LIBMI application must use mi_free to explicitly free all allocations that mi_alloc( ) makes.

User memory remains valid until whichever of the following events occurs first:

To conserve resources, use the mi_free( ) function to explicitly deallocate the user memory once your DataBlade API module no longer needs it. The mi_free( ) function is the destructor function for user memory.

Important:
Use mi_free( ) only for user memory that you have explicitly allocated with mi_alloc( ), mi_dalloc( ), or mi_zalloc( ). Do not use this function to free structures that other DataBlade API functions allocate.

Keep the following restrictions in mind about memory deallocation:

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]