305 {
307 ASSERT(isolate !=
nullptr);
308 auto isolate_group = isolate->group();
309 Heap* heap = isolate_group->heap();
311 JSONObject obj(stream);
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 { heap->PrintToJSONObject(
Heap::kNew, &heaps); }
327 { heap->PrintToJSONObject(
Heap::kOld, &heaps); }
328 }
329
330 {
331 JSONObject memory(&obj, "memoryUsage");
332 { heap->PrintMemoryUsageJSON(&memory); }
333 }
334
336 CountObjectsVisitor visitor(thread,
NumCids());
337 {
338 HeapIterationScope iter(thread);
339 iter.IterateObjects(&visitor);
340 isolate->group()->VisitWeakPersistentHandles(&visitor);
341 }
342
343 {
344 JSONArray arr(&obj, "members");
346 for (intptr_t i = 3; i < classes_.num_cids(); i++) {
348
350 if (cls.IsNull()) continue;
351
352 JSONObject obj(&arr);
353 obj.AddProperty("type", "ClassHeapStats");
354 obj.AddProperty("class", cls);
355 intptr_t
count = visitor.new_count_[i] + visitor.old_count_[i];
356 intptr_t
size = visitor.new_size_[i] + visitor.old_size_[i];
357 obj.AddProperty64(
"instancesAccumulated",
count);
358 obj.AddProperty64("accumulatedSize", size);
359 obj.AddProperty64(
"instancesCurrent",
count);
360 obj.AddProperty64("bytesCurrent", size);
361
362 if (internal) {
363 {
364 JSONArray new_stats(&obj, "_new");
365 new_stats.AddValue(visitor.new_count_[i]);
366 new_stats.AddValue(visitor.new_size_[i]);
367 new_stats.AddValue(visitor.new_external_size_[i]);
368 }
369 {
370 JSONArray old_stats(&obj, "_old");
371 old_stats.AddValue(visitor.old_count_[i]);
372 old_stats.AddValue(visitor.old_size_[i]);
373 old_stats.AddValue(visitor.old_external_size_[i]);
374 }
375 }
376 }
377 }
378}
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