AllocationMemoryJson class

Structure of the memory JSON file

{
  "allocations": {
    "version": 2,
    "dartDevToolsScreen": "memory"
    "data": [
      # Encoded ClassHeapStats see section below.
    ]
  }
}

Header portion (memoryJsonHeader)

{
  "allocations": {
    "version": 2,
    "dartDevToolsScreen": "memory"
    "data": [

Encoded Allocations entry (AllocationMemoryJson)

{
  "class" : {
     id: "classes/1"
     name: "AClassName"
   },
  "instancesCurrent": 100,
  "instancesAccumulated": 0,
  "bytesCurrent": 55,
  "accumulatedSize": 5,
  "_new": [
    100,
    50,
    5
  ],
  "_old": [
    0,
    0,
    0
  ]
},

Trailer portion (memoryJsonTrailer)

    ]
  }
}
Inheritance

Constructors

AllocationMemoryJson()
AllocationMemoryJson.decode({required String argJsonString, Map<String, Object?>? argDecodedMap})
Given a JSON string representing an array of HeapSample, decode to a list of HeapSample.

Properties

data → List<ClassHeapStats>
If data is empty, check isMatchedVersion and isMemoryPayload to ensure the JSON file loaded is a memory file.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
isMatchedVersion → bool
Imported JSON data loaded and converted, if necessary, to the latest version.
no setterinherited
isMemoryPayload → bool
JSON payload field "dart<T>DevToolsScreen" has a value of "memory" e.g., "dartDevToolsScreen": "memory"
no setterinherited
payloadVersion → int
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
version → int
no setteroverride

Methods

encode(ClassHeapStats sample) → String
JSON encoded version of the sample.
override
encodeAnother(ClassHeapStats sample) → String
More than one encoded ClassHeapStats, add a comma and the encoded sample.
override
fromJson(Map<String, Object?> json) → ClassHeapStats
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
upgradeToVersion(Map<String, Object?> payload, int oldVersion) → Map<String, dynamic>
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

Allocations Header portion:
no setter

Static Methods

encodeList(List<ClassHeapStats> data) → String
Given a list of HeapSample, encode as a Json string.

Constants

allocationFormatVersion → const int