next up previous contents
Next: Code generation Up: Compiling and using OPTIMQR Previous: A sample run   Contents

Memory management

As seen in the diagnostic messages from the optimqr program, a large number of ``solution buffers'' are allocated initially. optimqr has it's own memory management system, in order to guarantee $\mathcal{O}(1)$ memory allocation and de-allocation.

The memory management subsystem cannot however, allocate more buffers as they are needed, during the optimization run. Therefore, a sufficient number of buffers must be pre-allocated. This number is defined in the file optimqr.h:

/* The number of elements to allocate for the dmh subsystem */
#ifdef ROWORDER_BIPORDER
#define MAX_MEM  (1024*1024*100)
#endif
#ifdef ROWORDER_RECORDER
#define MAX_MEM  (1024*1024*400)
#endif
The default settings limit the memory consumption to 100 MB when using the ROWORDER_BIPORDER heuristic, and to 400 MB when using the ROWORDER_RECORDER heuristic. These numbers can be increased if needed.

The memory subsystem ensures, that the most recently freed buffer will be returned the next time a buffer is allocated. This makes the memory handling work well even when the system is paging memory to disk. You can therefore often get reasonable performance, even when specifying a much larger buffer space than there is physical memory in the computer.




1999-04-09