xHarbour Reference Documentation > Function Reference |
Returns memory statistics.
Memory( <nWhichMemory> ) --> nMemoryUsage
Constants for memory statistics
Constant | Value | Description |
---|---|---|
HB_MEM_CHAR | 0 | Free Variable Space (KB) |
HB_MEM_BLOCK | 1 | Largest String (KB) |
HB_MEM_RUN | 2 | RUN Memory (KB) |
HB_MEM_VM | 3 | Virtual Memory (KB) |
HB_MEM_FM | 101 | Fixed Memory/Heap (KB) |
HB_MEM_FMSEGS | 102 | Segments in Fixed Memory/Heap |
HB_MEM_SWAP | 103 | Free Swap Memory (KB) |
HB_MEM_CONV | 104 | Free Conventional (KB) |
HB_MEM_EMSUSED | 105 | Used Expanded Memory (KB) |
HB_MEM_USED | 1001 | Memory used (bytes) |
HB_MEM_USEDMAX | 1002 | Maximum memory used (bytes) |
HB_MEM_STACKITEMS | 1003 | Total items on the stack |
HB_MEM_STACK | 1004 | Total memory size used by the stack (bytes) |
HB_MEM_STACK_TOP | 1005 | Total items currently on the stack |
HB_MEM_LIST_BLOCKS | 1006 | List all allocated blocks |
The function returns a numeric value indicating usage of the specified memory.
The function is used to obtain values for current memory usage. The type of memory to use must be specified with #define constants. Not all memory types are supported on all platforms. If a memory type cannot be queried, the return value is zero.
Memory() can give only a "snapshot" of current memory usage while the function is being executed. The memory usage may have changed when the function returns due to the activity of xHarbour's garbage collector.
See also: | GetEnv(), HB_GCAll() |
Category: | Debug functions , Environment functions , xHarbour extensions |
Header: | hbmemory.ch |
Source: | vm\fm.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com