-
Notifications
You must be signed in to change notification settings - Fork 6k
[profiling] Memory Profiling support for iOS #18516
Changes from 4 commits
f6b1431
bb431f0
26c2e9a
1b8a3dd
338ee30
1c8445f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,15 +29,29 @@ struct CpuUsageInfo { | |
| double total_cpu_usage; | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Memory usage stats. `dirty_memory_usage` is the number of mega bytes | ||
| * such that the app uses its physical memory for dirty memory. Dirty memory | ||
| * is the memory data that cannot be paged to disk. `owned_shared_memory_usage` | ||
| * is the number of mega bytes such that the app uses its physicaal memory for | ||
| * shared memory, including loaded frameworks and executables. On iOS, it's | ||
| * `physical memory - dirty memory`. | ||
| */ | ||
| struct MemoryUsageInfo { | ||
| double dirty_memory_usage; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document what unit it uses (e.g., MB, KB, or something else)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| double owned_shared_memory_usage; | ||
| }; | ||
|
|
||
| /** | ||
| * @brief Container for the metrics we collect during each run of `Sampler`. | ||
| * This currently holds `CpuUsageInfo` but the intent is to expand it to other | ||
| * metrics. | ||
| * This currently holds `CpuUsageInfo` and `MemoryUsageInfo` but the intent | ||
| * is to expand it to other metrics. | ||
| * | ||
| * @see flutter::Sampler | ||
| */ | ||
| struct ProfileSample { | ||
| std::optional<CpuUsageInfo> cpu_usage; | ||
| std::optional<MemoryUsageInfo> 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
floatfirst, and eventually becomes adouble? Should both befloatordouble?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.