Open makesimple opened 3 years ago
I found another contradiction: According to the above comment, heapCapacity don't include the externalUsage, but the code from devtools' source:
final HeapSample sample = HeapSample( time, processRss, // Displaying capacity dashed line on top of stacked (used + external). capacity + external, used, external, fromGC, adbMemoryInfo, eventSample, rasterCache, );
the snippet was copied from the memory_protocol.dart, in MemoryTracker._recalculate function,it tells me that the capacity includes the external (according to the comment, external is the native, and HeapSample.capacity is the "Allocated" in memory hover card). This confuses me.
@terrylucas and @bkonyi - can you add any explanation here?
@polina-c this is an old issue, but do you know if this discrepancy still exists or was this memory calculation logic something you fixed during your time working on the DevTools memory tooling?
Calculations definitely changed. I suggest to close the issue. If there are issues, they are different now.
Hi,I read many explaination about the "Allocated" item in memory tab of the devtools. The first explanation is "Allocated: Current capacity of the heap is typically slightly larger than total size of all heap objects." the second explaination from the comment in source code is:
The above comment is from : third_party/dart/pkg/vm_service/lib/src/vm_service.dart
The second one solved a lot of my confusion,but I still have a last confusion that is why the memory of heap capacity is not equal to the heap of VM?
for example ,see my screeshot,the first one is memory tab, the second is the VM.
According to the VM tab, the total memory is 44.0 + 72.8 + 16.8 = 133.6 ACcording to the memory tab, the Allocated is 253.45
the delta is 253.45 - 133.6 = 119.85, it's a big gap among them, how to explain it?