Huygens Embedded Memory Manager


The MacOS X seems to be very conservative with the memory management, and apparently won't give the Huygens Software large memory blocks again after it already received a large one once during a program run.

Other operating systems (like many flavours of Windows) are known for suffering from memory fragmentation, that prevents the allocation of large memory chuncks.

More details are explained in Not Enough Memory Available.

To circumvent these difficulties, you can enable a built-in memory manager that will demand and allocate the largest memory block possible at the program startup (or many of them), and handle it internaly during the rest of the execution.

EMM in preferences


In the Program Preferences you can enable or disable the memory allocator (bottom). Then restart the program.

EMM in command line


The EEM (from Embedded Memory Manager) can also be activated with the command line option -emm enable:

1) Open a terminal and go to the executables directory, typically /Applications/SVI/bin in the Mac or C:\Program Files\SVI in Windows.

2) run the program with the -emm enable option:

./essential -emm enable

(mind the dot-slash in the Mac case, for windows just use essential.exe instead)

EMM at runtime


The huOpt initEmm Tcl Huygens command can be used on the Tcl Shell or in a script to activate it during runtime.

Messages from the EMM


When it is active, it will try to allocate a few large blocks of memory, demanding them to the operating system. It will start with a very large query, and will continue with smaller queries until one block is granted. After that it may continue asking for another block. Therefore you may see some memory allocation errors at startup: these are the queries that were rejected by the OS. They look like follow, and despite their appearance they are not errors that would prevent the software from running:


 *** error: can't allocate region
huygenspro.remote(4689,0xa0a7b074) malloc: *** mmap(size=847233024)
failed (error code=12)
*** error: can't allocate region
huygenspro.remote(4689,0xa0a7b074) malloc: *** mmap(size=836747264)
failed (error code=12)
...
Embedded memory manager: Total allocated memory: 2707.15 MB in 3 buffers

EMM and batch processing


Activating the EMM for batch processing is not recommended: the main window and each of the batch tasks will try to allocate as much memory as possible independently, and this will have an effect contrary to the intended one. The batch tasks may not have enough memory to run!!!

More information about memory