System.THeapStatus

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

  THeapStatus = record
    TotalAddrSpace: NativeUInt;
    TotalUncommitted: NativeUInt;
    TotalCommitted: NativeUInt;
    TotalAllocated: NativeUInt;
    TotalFree: NativeUInt;
    FreeSmall: NativeUInt;
    FreeBig: NativeUInt;
    Unused: NativeUInt;
    Overhead: NativeUInt;
    HeapErrorCode: Cardinal;
  end deprecated;

C++

struct DECLSPEC_DRECORD THeapStatus _DEPRECATED_ATTRIBUTE0
{
public:
    NativeUInt TotalAddrSpace;
    NativeUInt TotalUncommitted;
    NativeUInt TotalCommitted;
    NativeUInt TotalAllocated;
    NativeUInt TotalFree;
    NativeUInt FreeSmall;
    NativeUInt FreeBig;
    NativeUInt Unused;
    NativeUInt Overhead;
    unsigned HeapErrorCode;
};

Properties

Type Visibility Source Unit Parent
record
struct
public
System.pas
System.hpp
System System

Description

Warning: THeapStatus is deprecated.

THeapStatus represents information about the global heap.

THeapStatus represents information about the current memory manager. These are the meanings of the values in each field:



Field Meaning

TotalAddrSpace

The (current) total address space available to your program, in bytes. This will grow as your program's dynamic memory usage grows.

TotalUncommitted

The total number of bytes (of TotalAddrSpace) for which space has not been allocated in the swap file.

TotalCommitted

The total number of bytes (of TotalAddrSpace) for which space has been allocated in the swap file. Note: TotalUncommitted + TotalCommitted = TotalAddrSpace

TotalAllocated

The total number of bytes dynamically allocated by your program.

TotalFree

The total number of free bytes available in the (current) address space for allocation by your program. If this number is exceeded, and enough virtual memory is available, more address space will be allocated from the OS; TotalAddrSpace will be incremented accordingly.

FreeSmall

Total bytes of small memory blocks that are not currently allocated by your program.

FreeBig

Total bytes of big memory blocks that are not currently allocated by your program. Large free blocks can be created by coalescing smaller, contiguous, free blocks or by freeing a large dynamic allocation. (The exact size of the blocks is immaterial.)

Unused

Total number of bytes that have never been allocated by your program. Note: Unused + FreeBig + FreeSmall = TotalFree. These three fields (Unused, FreeBig, and FreeSmall) refer to dynamic allocation by the user program.

Overhead

The total number of bytes required by the heap manager to manage all the blocks dynamically allocated by your program.

HeapErrorCode

Indicates the current status of the heap, as internally determined.



Note: TotalAddrSpace, TotalUncommitted, and TotalCommitted refer to OS memory used by the program, whereas TotalAllocated and TotalFree refer to the heap memory used within the program by dynamic allocations. Therefore, to monitor dynamic memory used in your program, use TotalAllocated and TotalFree.