MemoryInUseBy
MemoryInUseBy(variable)
Returns the memory, i.e., number of bytes, currently being used to store the mid and prob values of variable.
This function requires Analtyica Enterprise or better.
This count may not be entirely accurate for several reasons. Internally, portions of subarrays may be shared between different variables, or even within the same array. These shared sub-arrays will be double-counted. Also, the same text value may exist in several cells, with the internal representating sharing the character block, so that MemoryInUseBy double counts the memory used to store the character sequence. Thus, the count tends to be an upper bound.
There are also a few things that are not fully counted. The space used by local indexes is generally not tallied. Also, memory used internally by «LP», «QP» or «NLP» objects is not only partially counted (Analytica has no way of knowing exactly how much memory is being consumed internally by the Frontline Solver). Finally, some memory-management overhead is not counted -- basic overhead used by both the operating system and Analytica's heap managers to track allocations and deallocations.
The result returned from MemoryInUseBy reflects the amount of memory used by the mid and prob values at the time it is called. When a result is computed, intermediate values may require more space than the final result alone, and in some cases when these intermediates have extra dimensions, this can be dramatically more space. The space temporarily utilized during computation is not measured by this function, and there is currently no method for accessing the maximum amount of memory consumed during a computation from within Analytica.
Example
Determine amount of memory used to store results for Variable Revenue:
MemoryInUseBy(Revenue)
Enable comment auto-refresher