New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print trees in the memory profiler's output. #5284
Conversation
Critic review: https://critic.hoppipolla.co.uk/r/4310 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
r? @jdm |
It just occurred to me that a |
(*t).children.len() - 1 | ||
}, | ||
}; | ||
t = &mut (*t).children[i]; |
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 believe this should be possible in safe code, by explicitly moving out of t
before reassigning, e.g.:
let tmp = t;
t = &mut tmp.children[i];
cf.
Two nits; otherwise it looks fine. |
Memory reports are much nicer to read when grouped into trees, which requires giving each report a path instead of a name. Sample output: ``` Begin memory reports | | 2.51 MiB -- pages | 2.51 MiB -- url(file:///home/njn/moz/servo/../servo-static-suite/wikipedia/Guardians%20of%20the%20Galaxy%20(film)%20-%20Wikipedia,%20the%20free%20encyclopedia.html) | 2.51 MiB -- display-list | | 238.89 MiB -- resident-according-to-smaps | 188.31 MiB -- anonymous (rw-p) | 27.29 MiB -- /home/njn/moz/servo/components/servo/target/debug/servo (r-xp) | 7.82 MiB -- other | 6.65 MiB -- [heap] (rw-p) | 3.55 MiB -- /usr/lib/x86_64-linux-gnu/dri/i965_dri.so (r-xp) | 1.42 MiB -- /lib/x86_64-linux-gnu/libc-2.19.so (r-xp) | 1.13 MiB -- /home/njn/moz/servo/components/servo/target/debug/servo (r--p) | 0.74 MiB -- /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (r-xp) | 0.73 MiB -- /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 (r-xp) | 0.65 MiB -- /lib/x86_64-linux-gnu/libm-2.19.so (r-xp) | 0.60 MiB -- /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1 (r-xp) | | 71.08 MiB -- jemalloc-heap-active | 59.11 MiB -- jemalloc-heap-allocated | 180.00 MiB -- jemalloc-heap-mapped | 232.87 MiB -- resident | 54.43 MiB -- system-heap-allocated | 3130.11 MiB -- vsize | End memory reports ```
14dd3b7
to
fe3e932
Compare
Memory reports are much nicer to read when grouped into trees, which requires giving each report a path instead of a name. Sample output: ``` Begin memory reports | | 2.51 MiB -- pages | 2.51 MiB -- url(file:///home/njn/moz/servo/../servo-static-suite/wikipedia/Guardians%20of%20the%20Galaxy%20(film)%20-%20Wikipedia,%20the%20free%20encyclopedia.html) | 2.51 MiB -- display-list | | 238.89 MiB -- resident-according-to-smaps | 188.31 MiB -- anonymous (rw-p) | 27.29 MiB -- /home/njn/moz/servo/components/servo/target/debug/servo (r-xp) | 7.82 MiB -- other | 6.65 MiB -- [heap] (rw-p) | 3.55 MiB -- /usr/lib/x86_64-linux-gnu/dri/i965_dri.so (r-xp) | 1.42 MiB -- /lib/x86_64-linux-gnu/libc-2.19.so (r-xp) | 1.13 MiB -- /home/njn/moz/servo/components/servo/target/debug/servo (r--p) | 0.74 MiB -- /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (r-xp) | 0.73 MiB -- /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 (r-xp) | 0.65 MiB -- /lib/x86_64-linux-gnu/libm-2.19.so (r-xp) | 0.60 MiB -- /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1 (r-xp) | | 71.08 MiB -- jemalloc-heap-active | 59.11 MiB -- jemalloc-heap-allocated | 180.00 MiB -- jemalloc-heap-mapped | 232.87 MiB -- resident | 54.43 MiB -- system-heap-allocated | 3130.11 MiB -- vsize | End memory reports ```
Memory reports are much nicer to read when grouped into trees, which requires giving each report a path instead of a name.
Sample output: