Tuesday, June 8, 2010

Matlab's mxMalloc/mxFree: inefficient for memory intensive algorithms

This was a real headache.
When programming Matlab mex programs, it is customary to use the Matlab's mxMalloc/mxFree routines to manage the memory. It seems that aligns the data (maybe for efficiency), and also have several garbage collecting features (on termination of the program).

It turns out that these routines are very slow and for memory intensive applications, i.e. dynamic lists.

Some reading about using malloc/free inside Matlab mex:

No comments:

Post a Comment