C_DisableInMemoryLogging

Call C_DisableInMemoryLogging to force all log files to be stored on disk.

void C_DisableInMemoryLogging(

TOrcFxAPIHandle ModelHandle,

int *lpStatus

);

Parameters

ModelHandle (IN)

The handle of the model.

lpStatus (OUT)

Points to a variable in which the status result for the function call will be returned.

Remarks

OrcaFlex use log files to store the logged values from a simulation. Log files are either held in memory or stored in temporary disk files. An OrcaFlex simulation file essentially comprises the data file and the log file: when OrcaFlex saves a simulation, the log file is copied to the simulation file.

Storing the log file in memory results in faster read and write access. However, system memory is a limited resource and it is quite possible to have log files which are larger than the total available system memory. Multithreading compounds this problem since, if multiple simulations are running simultaneously, then they each require a separate log file. OrcaFlex will only use an in-memory log if there is sufficient memory available.

There are two main scenarios to consider:

This analysis suggests the following strategy: use file-based logs when running simulations, and in-memory log files when extracting results. This avoids consuming a lot of system memory resources for minimal performance gain. OrcaFlex implements this strategy as follows:

The C_DefaultInMemoryLogging, C_DisableInMemoryLogging and C_ForceInMemoryLogging functions enable you to implement a similar policy for your application.

Note: Existing log files are not converted between disk files and and in-memory files. Therefore the typical use is to call this function immediately after calling C_CreateModel.

See also

C_DefaultInMemoryLogging, C_ForceInMemoryLogging, C_UseVirtualLogging.