-
Notifications
You must be signed in to change notification settings - Fork 6k
[profiling] Memory Profiling support for iOS #18516
[profiling] Memory Profiling support for iOS #18516
Conversation
iskakaushik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo rename.
shell/profiling/sampling_profiler.h
Outdated
| */ | ||
| struct MemoryUsageInfo { | ||
| double dirty_memory_usage; | ||
| double owned_share_memory_usage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename this to owned_shared_memory_usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
liyuqian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * `physical memory - dirty memory`. | ||
| */ | ||
| struct MemoryUsageInfo { | ||
| double dirty_memory_usage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document what unit it uses (e.g., MB, KB, or something else)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed the "mega bytes" in the struct documentation... Maybe also put a capitalized MB there, or add a document for each field so they're more prominent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rephrased the docstring a bit so that "MB" should be more obvious than "mega bytes". I will keep the docstring as is so it is consistent with the CPU part.
As another way, we can also rename them to dirty_memory_usage_mb and owned_shared_memory_usage_mb, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MB docstring as it is now looks good!
|
This pull request is not suitable for automatic merging in its current state.
|
| const double dirty_memory_usage = | ||
| static_cast<float>(task_memory_info.phys_footprint) / 1024.0 / 1024.0; | ||
| const double owned_shared_memory_usage = | ||
| static_cast<float>(task_memory_info.resident_size) / 1024.0 / 1024.0 - dirty_memory_usage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason that it's casting to float first, and eventually becomes a double? Should both be float or double?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, as definition this should be both double.
| * `physical memory - dirty memory`. | ||
| */ | ||
| struct MemoryUsageInfo { | ||
| double dirty_memory_usage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MB docstring as it is now looks good!
Based on Kaushik's work for iOS CPU profiling, I added the memory profiling within the same scheduled task. The memory profiling methodologies were discussed in the internal doc. Please see go/flutter-ios-memory-profiling.
Roll Engine from 9ce1e5c to 1a83498 (69 revisions) flutter/engine@9ce1e5c...1a83498 2020-05-26 hterkelsen@users.noreply.github.com Revert "Update CanvasKit to 0.15.0 (flutter#18570)" (flutter/engine#18600) 2020-05-26 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from TSEOq... to hr-HZ... (flutter/engine#18594) 2020-05-26 skia-flutter-autoroll@skia.org Roll Dart SDK from 65113fd73dec to 9e3b0289197d (2 revisions) (flutter/engine#18593) 2020-05-26 skia-flutter-autoroll@skia.org Roll Skia from b6d158aaf3dd to e4b4ca1050b9 (1 revision) (flutter/engine#18592) 2020-05-26 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from DzG49... to pLp67... (flutter/engine#18591) 2020-05-24 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from Oz016... to TSEOq... (flutter/engine#18590) 2020-05-23 skia-flutter-autoroll@skia.org Roll Skia from afd8a6c6ae87 to b6d158aaf3dd (3 revisions) (flutter/engine#18588) 2020-05-22 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 99Z4_... to Oz016... (flutter/engine#18582) 2020-05-22 skia-flutter-autoroll@skia.org Roll Skia from ec31488ace66 to afd8a6c6ae87 (1 revision) (flutter/engine#18581) 2020-05-22 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from Kvwlr... to DzG49... (flutter/engine#18580) 2020-05-22 skia-flutter-autoroll@skia.org Roll Skia from 80abb89c3632 to ec31488ace66 (1 revision) (flutter/engine#18579) 2020-05-22 skia-flutter-autoroll@skia.org Roll Skia from da90c3765908 to 80abb89c3632 (4 revisions) (flutter/engine#18577) 2020-05-22 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from _zNmv... to 99Z4_... (flutter/engine#18576) 2020-05-22 skia-flutter-autoroll@skia.org Roll Skia from 317dce5c81c0 to da90c3765908 (1 revision) (flutter/engine#18575) 2020-05-22 skia-flutter-autoroll@skia.org Roll Dart SDK from 4ee57c08e0a6 to 65113fd73dec (3 revisions) (flutter/engine#18574) 2020-05-22 skia-flutter-autoroll@skia.org Roll Skia from 67e21a19259b to 317dce5c81c0 (3 revisions) (flutter/engine#18573) 2020-05-22 hterkelsen@users.noreply.github.com Update CanvasKit to 0.15.0 (flutter/engine#18570) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from 3d52abc84667 to 67e21a19259b (1 revision) (flutter/engine#18568) 2020-05-21 skia-flutter-autoroll@skia.org Roll Dart SDK from 396b5fb7a97d to 4ee57c08e0a6 (6 revisions) (flutter/engine#18567) 2020-05-21 robert.ancell@canonical.com Add fl_value_to_string (flutter/engine#18540) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from 1e63279156d6 to 3d52abc84667 (5 revisions) (flutter/engine#18566) 2020-05-21 chris@bracken.jp null-annotate semantics.dart (flutter/engine#18553) 2020-05-21 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from ciqRH... to Kvwlr... (flutter/engine#18565) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from b37105ea6cca to 1e63279156d6 (9 revisions) (flutter/engine#18564) 2020-05-21 gw280@google.com Implement WriteAtomically using write/fsync on all platforms, and enable (flutter/engine#18320) 2020-05-21 skia-flutter-autoroll@skia.org Roll Dart SDK from ecce58c1e354 to 396b5fb7a97d (2 revisions) (flutter/engine#18560) 2020-05-21 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from RNByJ... to _zNmv... (flutter/engine#18558) 2020-05-21 st.krwlng@gmail.com [profiling] Memory Profiling support for iOS (flutter/engine#18516) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from 22636205ce92 to b37105ea6cca (2 revisions) (flutter/engine#18557) 2020-05-21 skia-flutter-autoroll@skia.org Roll Dart SDK from d551980ac9fc to ecce58c1e354 (2 revisions) (flutter/engine#18556) 2020-05-21 skia-flutter-autoroll@skia.org Roll Dart SDK from bf7e9d13d730 to d551980ac9fc (6 revisions) (flutter/engine#18551) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from 4c0578632217 to 22636205ce92 (4 revisions) (flutter/engine#18550) 2020-05-21 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from ThMeW... to ciqRH... (flutter/engine#18549) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from 67ff541ac116 to 4c0578632217 (1 revision) (flutter/engine#18547) 2020-05-21 xster@google.com Let run_tests.py just stream output (flutter/engine#18534) 2020-05-21 robert.ancell@canonical.com Add FlKeyEventPlugin (flutter/engine#18313) 2020-05-21 mehmetf@users.noreply.github.com Add tests for StandardMethodCodec (flutter/engine#18521) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from f83baf230c69 to 67ff541ac116 (1 revision) (flutter/engine#18545) 2020-05-21 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 3o9aQ... to RNByJ... (flutter/engine#18543) 2020-05-21 dworsham@google.com fuchsia: Fix runtime_tests and shell_tests (flutter/engine#18492) 2020-05-21 skia-flutter-autoroll@skia.org Roll Skia from d2dc8ddcdf5e to f83baf230c69 (2 revisions) (flutter/engine#18539) 2020-05-21 skia-flutter-autoroll@skia.org Roll Dart SDK from 7aa8656d1dd8 to bf7e9d13d730 (21 revisions) (flutter/engine#18538) 2020-05-21 robert.ancell@canonical.com Add FlMethodChannel, FlMethodCodec, FlStandardMethodCodec and FlJsonMethodCodec (flutter/engine#18220) 2020-05-20 ferhat@gmail.com [web] Fix arc rendering when it starts a new sub path. (flutter/engine#18535) 2020-05-20 garyq@google.com Send platformResolvedLocale from iOS embedder (flutter/engine#18519) 2020-05-20 dkwingsmt@users.noreply.github.com System mouse cursor: macOS (flutter/engine#18131) ...
|
@terrylucas , the Flutter engine now reports iOS memory usage in tracing events (we could also add Android usages in the future so we don't have to rely on adb). Do you think this would be useful for DevTools? Also CC @cobblest @dnfield |
Based on Kaushik's work for iOS CPU profiling, I added the memory profiling within the same scheduled task.
The memory profiling methodologies were discussed in the internal doc. Please see go/flutter-ios-memory-profiling.