Initializing help system before first use

memoryuse

Purpose
Get an estimate of the memory usage of an entity, a module or the entire model.
Synopsis
size_t memoryuse(XPRMcontext ctx,int type, void *ref);
Arguments
ctx 
Mosel's execution context
type 
Type or structure of the object or 0
ref 
Reference of the object or NULL
Return value
An estimate of the memory usage in bytes or -1 if the evaluation cannot be performed.
Further information
1. If the type argument is 0 the reference ref is interpreted as a constant string. If this string is NULL or empty the returned value corresponds to the total amount of memory used by the running model including the loaded modules (if they implement the service XPRM_SRV_MEMUSE). If the string is not empty it corresponds to the name of a module: the returned value is the memory consumed by this module that must be currently used by the model.
2. The argument type can be either a type code ( XPRM_TYP_* constants or an extended type code) or a structure code ( XPRM_STR_SET, XPRM_STR_LIST or XPRM_STR_ARR). For the types integer, real, boolean and mpvar the value returned is the constant amount of memory required by a variable of the corresponding type. For a reference to a string or linctr the effective memory used by the internal datastructure is returned. In the case of a set or a list of a referenced type only the memory used to represent the collection is accounted, not its content. However the value reported for an array or record includes the memory used by the content of the structure except for strings.
3. For a module type it is required for the module to implement the service XPRM_SRV_MEMUSE for the result to be meaningful.

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.