Struct

struct MemoryInfo

public struct MemoryInfo

Description: Provides APIs for obtaining heap memory statistics.

static prop allocatedHeapSize

public static prop allocatedHeapSize: Int64

Description: Obtains the occupied size of the Cangjie heap, measured in bytes.

Type: Int64

static prop heapPhysicalMemory

public static prop heapPhysicalMemory: Int64

Description: Obtains the size of the physical memory occupied by the Cangjie heap on the Linux platform, measured in bytes. Obtains the size of the physical memory occupied by the Cangjie process on the Windows and macOS platforms, measured in bytes.

Type: Int64

static prop maxHeapSize

public static prop maxHeapSize: Int64

Description: Obtains the maximum usable size of the Cangjie heap, measured in bytes.

Example:

import std.runtime.*
main() {
  println(MemoryInfo.maxHeapSize)
}

Running result (subject to the actual environment):

268435456

Type: Int64

struct ThreadInfo

public struct ThreadInfo

Description: Provides APIs for obtaining statistics of Cangjie threads.

static prop blockingThreadCount

public static prop blockingThreadCount: Int64

Description: Obtains the number of blocked Cangjie threads.

Type: Int64

static prop nativeThreadCount

public static prop nativeThreadCount: Int64

Description: Obtains the number of physical threads.

Type: Int64

static prop threadCount

public static prop threadCount: Int64

Description: Obtains the number of current Cangjie threads.

Type: Int64