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

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Jun 24, 2020

Add tracing to Shell::NotifyLowMemoryWarning, since it can be expensive and we want to know if/when it's getting called.

Not sure how to add a test for this - I don't think we typically test these.

@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@auto-assign auto-assign bot requested a review from gaaclarke June 24, 2020 21:18
@dnfield dnfield force-pushed the trace_notify_low_mem branch from 69bd89a to 838a89f Compare June 24, 2020 21:19
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Please use the TraceFlow RAII wrapper to trace this. When that is used, you won't need an extra ivar, and we will be able to trace overlapping flows (i.e, if the application calls a low memory notification before the previous one has fully propagated).

@chinmaygarde
Copy link
Member

Oh, wait, you didn't want a Flow, well TraceNonce() instead of the ivar would still be the way to go.

@dnfield
Copy link
Contributor Author

dnfield commented Jun 24, 2020

Done - using TraceNonce now.

Should this be a flow event? I'm not always clear on how those are helpful

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

Should this be a flow event? I'm not always clear on how those are helpful

Personally, I find flows more useful when:

  • There are tons of these traces in a short period of time.
  • These traces are overlapping.
  • I need to know specific slice the flows pass through.

It seems like none of these conditions hold here so your intuition about using async events here is spot on.

@dnfield dnfield 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 Jun 24, 2020
@fluttergithubbot fluttergithubbot merged commit 35d7d4a into flutter:master Jun 24, 2020
zhongwuzw pushed a commit to zhongwuzw/engine that referenced this pull request Jun 24, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 25, 2020
@dnfield dnfield deleted the trace_notify_low_mem branch June 25, 2020 04:45
@liyuqian liyuqian added the perf: memory Performance issues related to memory label Jun 25, 2020
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 waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants