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.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
asFloat (af) | bool | ![]() |
|
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) | bool | ||
freeMemory (fr) | bool | ![]() |
|
|
|||
gigaByte (gb) | bool | ![]() |
|
|
|||
heapMemory (he) | bool | ![]() |
|
|
|||
kiloByte (kb) | bool | ![]() |
|
|
|||
megaByte (mb) | bool | ![]() |
|
|
|||
pageFaults (pf) | bool | ![]() |
|
|
|||
pageReclaims (pr) | bool | ![]() |
|
|
|||
physicalMemory (phy) | bool | ![]() |
|
|
|||
summary (sum) | bool | ![]() |
|
|
|||
swapFree (swf) | bool | ![]() |
|
|
|||
swapLogical (swl) | bool | ![]() |
|
|
|||
swapMax (swm) | bool | ![]() |
|
|
|||
swapPhysical (swp) | bool | ![]() |
|
|
|||
swapReserved (swr) | bool | ||
swapVirtual (swv) | bool | ![]() |
|
|
|||
swaps (sw) | bool | ![]() |
|
|
Derived from mel command maya.cmds.memory
Example:
import pymel.core as pm
pm.memory(freeMemory=True)
# Result: 0 #
pm.memory(freeMemory=True megaByte=True)
521
pm.memory(freeMemory=True megaByte=True asFloat=True)
521.33203125