305 {
307 ASSERT(isolate !=
nullptr);
308 auto isolate_group = isolate->group();
309 Heap* heap = isolate_group->heap();
312 obj.AddProperty("type", "AllocationProfile");
313 if (isolate_group->last_allocationprofile_accumulator_reset_timestamp() !=
314 0) {
315 obj.AddPropertyF(
316 "dateLastAccumulatorReset",
"%" Pd64 "",
317 isolate_group->last_allocationprofile_accumulator_reset_timestamp());
318 }
319 if (isolate_group->last_allocationprofile_gc_timestamp() != 0) {
320 obj.AddPropertyF(
"dateLastServiceGC",
"%" Pd64 "",
321 isolate_group->last_allocationprofile_gc_timestamp());
322 }
323
324 if (internal) {
325 JSONObject heaps(&obj, "_heaps");
326 {
328 }
329 {
331 }
332 }
333
334 {
335 JSONObject memory(&obj, "memoryUsage");
336 {
337 heap->PrintMemoryUsageJSON(&memory);
338 }
339 }
340
342 CountObjectsVisitor visitor(thread,
NumCids());
343 {
344 HeapIterationScope iter(thread);
345 iter.IterateObjects(&visitor);
346 isolate->group()->VisitWeakPersistentHandles(&visitor);
347 }
348
349 {
350 JSONArray arr(&obj, "members");
352 for (intptr_t
i = 3;
i < classes_.num_cids();
i++) {
354
356 if (cls.IsNull()) continue;
357
358 JSONObject obj(&arr);
359 obj.AddProperty("type", "ClassHeapStats");
360 obj.AddProperty("class", cls);
361 intptr_t
count = visitor.new_count_[
i] + visitor.old_count_[
i];
362 intptr_t
size = visitor.new_size_[
i] + visitor.old_size_[
i];
363 obj.AddProperty64(
"instancesAccumulated",
count);
364 obj.AddProperty64(
"accumulatedSize",
size);
365 obj.AddProperty64(
"instancesCurrent",
count);
366 obj.AddProperty64(
"bytesCurrent",
size);
367
368 if (internal) {
369 {
370 JSONArray new_stats(&obj, "_new");
371 new_stats.AddValue(visitor.new_count_[
i]);
372 new_stats.AddValue(visitor.new_size_[
i]);
373 new_stats.AddValue(visitor.new_external_size_[
i]);
374 }
375 {
376 JSONArray old_stats(&obj, "_old");
377 old_stats.AddValue(visitor.old_count_[
i]);
378 old_stats.AddValue(visitor.old_size_[
i]);
379 old_stats.AddValue(visitor.old_external_size_[
i]);
380 }
381 }
382 }
383 }
384}
ClassPtr At(intptr_t cid) const
bool HasValidClassAt(intptr_t cid) const
static Isolate * Current()
static Thread * Current()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size