Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

memory [-adjustedVirtualMemory] [-asFloat] [-debug] [-freeMemory] [-gigaByte] [-heapMemory] [-kiloByte] [-megaByte] [-pageFaults] [-pageReclaims] [-physicalMemory] [-processVirtualMemory] [-summary] [-swapFree] [-swapLogical] [-swapMax] [-swapPhysical] [-swapReserved] [-swapVirtual] [-swaps]

memory is undoable, NOT queryable, and NOT editable.

Used to query essential statistics on memory availability and usage.

By default memory sizes are returned in bytes. Since Maya's command engine only supports 32-bit signed integers, any returned value which cannot fit into 31 bits will be truncated to 2,147,483,647 and a warning message displayed. To avoid having memory sizes truncated use one of the memory size flags to return the value in larger units (e.g. megabytes) or use the asFloat flag to return the value as a float.

Return value

None

Flags

adjustedVirtualMemory, asFloat, debug, freeMemory, gigaByte, heapMemory, kiloByte, megaByte, pageFaults, pageReclaims, physicalMemory, processVirtualMemory, summary, swapFree, swapLogical, swapMax, swapPhysical, swapReserved, swapVirtual, swaps
Long name (short name) Argument types Properties
-adjustedVirtualMemory(-av) create
Returns size of adjusted virtual memory allocated by the process. The adjustment is done by computing an offset when the application is launched that will be subtracted from the process virtual memory in order to give the adjusted value. The returned size is an approximation of the memory used by the process that can be more reliable in some cases, for instance on platforms where display drivers can reserve large ranges of memory addresses, therefore increasing the size of the process virtual memory, even though those addresses are actually not used.
-asFloat(-af) create
Causes numeric values to be returned as floats rather than ints. This can be useful if you wish to retain some of the significant digits lost when using the unit size flags.
-debug(-dbg) create
Print debugging statistics on arena memory (if it exists)
-freeMemory(-fr) create
Returns size of free memory
-gigaByte(-gb) create
Return memory sizes in gigabytes (1024*1024*1024 bytes)
-heapMemory(-he) create
Returns size of memory heap
-kiloByte(-kb) create
Return memory sizes in kilobytes (1024 bytes)
-megaByte(-mb) create
Return memory sizes in megabytes (1024*1024 bytes)
-pageFaults(-pf) create
Returns number of page faults
-pageReclaims(-pr) create
Returns number of page reclaims
-physicalMemory(-phy) create
Returns size of physical memory
-processVirtualMemory(-pv) create
Returns size of virtual memory allocated by the process
-summary(-sum) create
Returns a summary of memory usage. The size flags are ignored and all memory sizes are given in megabytes.
-swapFree(-swf) create
Returns size of free swap
-swapLogical(-swl) create
Returns size of logical swap
-swapMax(-swm) create
Returns maximum swap size
-swapPhysical(-swp) create
Returns size of physical swap
-swapReserved(-swr) create
Returns size of reserved swap
-swapVirtual(-swv) create
Returns size of virtual swap
-swaps(-sw) create
Returns number of swaps

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

memory -freeMemory;
// Result: 548388864 //

memory -freeMemory -megaByte;
// Result: 522 //

memory -freeMemory -megaByte -asFloat;
// Result: 521.683594 //