Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@AlbertWang0116
Copy link
Contributor

@AlbertWang0116 AlbertWang0116 commented May 19, 2020

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.

@AlbertWang0116 AlbertWang0116 marked this pull request as ready for review May 20, 2020 17:10
@auto-assign auto-assign bot requested a review from jason-simmons May 20, 2020 17:11
@AlbertWang0116
Copy link
Contributor Author

cc @iskakaushik @liyuqian

@iskakaushik iskakaushik self-requested a review May 20, 2020 17:18
Copy link
Contributor

@iskakaushik iskakaushik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo rename.

*/
struct MemoryUsageInfo {
double dirty_memory_usage;
double owned_share_memory_usage;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@iskakaushik iskakaushik added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label May 20, 2020
Copy link
Contributor

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can use the scenario_app to test this using iOS simulators, @blasten @cyanglaz ?

* `physical memory - dirty memory`.
*/
struct MemoryUsageInfo {
double dirty_memory_usage;
Copy link
Contributor

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)

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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!

@fluttergithubbot
Copy link
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Mac iOS Engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot fluttergithubbot removed the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label May 20, 2020
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;
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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!

@iskakaushik iskakaushik merged commit 2187523 into flutter:master May 21, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 21, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 21, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 22, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 22, 2020
wandyers pushed a commit to wandyers/engine that referenced this pull request May 23, 2020
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.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 23, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 26, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 26, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 26, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 26, 2020
liyuqian added a commit to liyuqian/flutter that referenced this pull request May 26, 2020
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)
...
@liyuqian liyuqian added perf: memory Performance issues related to memory severe: performance Relates to speed or footprint issues. labels May 29, 2020
@liyuqian
Copy link
Contributor

@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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes perf: memory Performance issues related to memory severe: performance Relates to speed or footprint issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants