usedBytes method

Future<int?> usedBytes()

Used heap bytes of the test isolate after a forced GC, or null.

Implementation

Future<int?> usedBytes() async {
  try {
    final profile = await _service.getAllocationProfile(
      _isolateId,
      gc: true,
    );
    return profile.memoryUsage?.heapUsage;
  } catch (_) {
    return null;
  }
}