diff options
author | Nicholas Nethercote <nnethercote@mozilla.com> | 2015-07-02 22:14:38 -0700 |
---|---|---|
committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2015-07-15 21:58:20 -0700 |
commit | 7429b90e02effd086681196050f400b2d1836903 (patch) | |
tree | 96e255399fde51f3c9cd093be407fe9cba909317 /components/script/dom/bindings/trace.rs | |
parent | ef9715203edf0a280d019b6e8823666f0e7020be (diff) | |
download | servo-7429b90e02effd086681196050f400b2d1836903.tar.gz servo-7429b90e02effd086681196050f400b2d1836903.zip |
Wire up the JS engine's memory reporting.
SpiderMonkey provides an extremely fine-grained breakdown of memory
usage, but for Servo we aggregate the measurements into a small number
of coarse buckets, which seems appropriate for the current level of
detail provided by Servo's memory profiler. Sample output:
```
| 10.99 MiB -- pages
| 7.75 MiB -- url(http://html5demos.com/worker)
| 4.63 MiB -- js
| 2.00 MiB -- gc-heap
| 0.94 MiB -- decommitted
| 0.92 MiB -- used
| 0.09 MiB -- unused
| 0.05 MiB -- admin
| 1.44 MiB -- malloc-heap
| 1.19 MiB -- non-heap
| [...]
| 3.24 MiB -- url(http://html5demos.com/js/worker-cruncher.js)
| 3.24 MiB -- js
| 1.17 MiB -- malloc-heap
| 1.06 MiB -- non-heap
| 1.00 MiB -- gc-heap
| 0.69 MiB -- used
| 0.19 MiB -- decommitted
| 0.09 MiB -- unused
| 0.03 MiB -- admin
```
Most of the changes are plumbing to get the script and worker tasks
communicating with the memory profiler task.
Diffstat (limited to 'components/script/dom/bindings/trace.rs')
-rw-r--r-- | components/script/dom/bindings/trace.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index b03255cd986..5ed5ed0bb52 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -60,6 +60,7 @@ use smallvec::SmallVec1; use msg::compositor_msg::ScriptListener; use msg::constellation_msg::ConstellationChan; use net_traits::image::base::Image; +use profile_traits::mem::ProfilerChan; use util::str::{LengthOrPercentageOrAuto}; use std::cell::{Cell, UnsafeCell, RefCell}; use std::collections::{HashMap, HashSet}; @@ -299,6 +300,7 @@ no_jsmanaged_fields!(CanvasGradientStop, LinearGradientStyle, RadialGradientStyl no_jsmanaged_fields!(LineCapStyle, LineJoinStyle, CompositionOrBlending); no_jsmanaged_fields!(RepetitionStyle); no_jsmanaged_fields!(WebGLError); +no_jsmanaged_fields!(ProfilerChan); impl JSTraceable for Box<ScriptChan+Send> { #[inline] |