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) #endifThe 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.