aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/memory.rs
Commit message (Collapse)AuthorAgeFilesLines
* Rename lots of profiling-related things.Nicholas Nethercote2015-03-251-161/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ BEFORE AFTER ------------------------------------------------------------------------ util::memory util::mem - heap_size_of - heap_size_of (unchanged) - SizeOf - HeapSizeOf - size_of_excluding_self - heap_size_of_children prof::mem prof::mem - MemoryProfilerChan - ProfilerChan - MemoryReport - Report - MemoryReportsChan - ReportsChan - MemoryReporter - Reporter - MemoryProfilerMsg - ProfilerMsg - {R,UnR}egisterMemoryReporter - {R,UnR}egisterReporter - MemoryProfiler - Prof - ReportsForest - ReportsForest (unchanged) - ReportsTree - ReportsTree (unchanged) - SystemMemoryReporter - SystemReporter prof::time prof::time - TimeProfilerChan - ProfilerChan - TimerMetadata - TimerMetadata (unchanged) - Formatable - Formattable [spelling!] - TimeProfilerMsg - ProfilerMsg - TimeProfilerCategory - ProfilerCategory - TimeProfilerBuckets - ProfilerBuckets - TimeProfiler - Profiler - TimerMetadataFrameType - TimerMetadataFrameType (unchanged) - TimerMetadataReflowType - TimerMetadataReflowType (unchanged) - ProfilerMetadata - ProfilerMetadata (unchanged) In a few places both prof::time and prof::mem are used, and so module-qualification is needed to avoid overlap, e.g. time::Profiler and mem::Profiler. Likewise with std::mem and prof::mem. This is not a big deal.
* Move profiler code from `util` into a new crate `profile`.Nicholas Nethercote2015-03-241-649/+3
| | | | | | | | | - Most of util::memory has been moved into profile::mem, though the `SizeOf` trait and related things remain in util::memory. The `SystemMemoryReporter` code is now in a submodule profile::mem::system_reporter. - util::time has been moved entirely into profile::time.
* Print trees in the memory profiler's output.Nicholas Nethercote2015-03-231-28/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Replace most usage of std::old_io::File.Ms2ger2015-03-201-13/+15
|
* Rename dlist to linked_list.Matt Brubeck2015-03-181-15/+15
|
* Fix some warnings in util.Simon Sapin2015-03-181-2/+2
|
* Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.Ms2ger2015-03-181-1/+2
|
* Put system memory measurements in a memory reporter.Nicholas Nethercote2015-03-171-51/+62
| | | | | | | | | | | | | | | | Currently the system memory measurements ("resident", "vsize", etc.) are not reported through the generic memory reporting mechanism, simply because they pre-date that mechanism. This changeset removes that special-casing. One consequence of this is that previously if a platform didn't implement one of the basic measurements, a '???' entry would be printed. Now nothing will be printed. This is no great loss and matches what Firefox does. Another consequence is that the order in which the measurements are printed is changed. I plan to fix this soon so that reports are sorted in a more sensible fashion.
* Remove the fake memory profiler thread.Nicholas Nethercote2015-03-161-29/+19
| | | | | | | | | | | | | | Currently if you don't specify the '-m' option, a fake do-nothing memory profiler thread gets created instead of the real one. It ignores all events except for `Exit`. And the timer thread doesn't get created so no `Print` events are sent. This changeset instead always creates the real thread. If you specify '-m' the *timer* thread is still absent and it won't print anything. However, the memory profiler thread will respond to register/unregister events, which is good, because if there's a bug in those (e.g. double-registration of a particular name) it'll show up in invocations that lack '-m'.
* Add memory reporting infrastructure and use it to measure the display list.Nicholas Nethercote2015-03-161-6/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset implements the beginnings of fine-grained measurement of Servo's data structures. - It adds a new `SizeOf` trait, which is used to measure the memory used by heap data structures, and implements it for some std types: Box, String, Option, Arc, Vec, and DList. - It adds a new `MemoryReporter` trait which is used to report memory measurements from other threads to the memory profiler. Reporters are registered and unregistered with the memory profiler, and the memory profiler makes measurement requests of reporters when necessary. - It plumbs a MemoryProfilerChan through to the layout task so it can register a memory reporter. - It implements the `SizeOf` trait for `DisplayList` and associated types, and adds a memory reporter that uses it. The display list hits 14.77 MiB when viewing tests/html/perf-rainbow.html, and 2.51 MiB when viewing the Guardians of the Galaxy Wikipedia page from servo-static-suite. Example output: 0.29: display-list::http://www.reddit.com/ 0.00: display-list::http://static.adzerk.net/reddit/ads.html?sr=-reddit.com,loggedout&bust2#http://www.reddit.com 0.00: display-list::http://www.reddit.com/static/createadframe.html There are a number of FIXME comments indicating sub-optimal things. This is a big enough change for now that doing them as follow-ups seems best.
* Cleanup compilation warning in OSX (should still work on Linux).Adenilson Cavalcanti2015-03-031-0/+1
|
* Replacing uses of accumulating fold with sumPrabhjyot Singh Sodhi2015-03-021-1/+2
|
* Remove uint/int inside `components/util` (partial #4745).Alexandru Cojocaru2015-02-281-1/+1
| | | | This leaves range.rs alone.
* Report detailed RSS measurements from /proc/<pid>/smaps on Linux.Nicholas Nethercote2015-02-231-4/+118
| | | | | | | | | | | | | | | | | | | | | | All anonymous segments are aggregated into a single measurement, as are all segments smaller than 512 KiB. Example output: 142.89: resident-according-to-smaps 97.84: - anonymous (rw-p) 23.98: - /home/njn/moz/servo/components/servo/target/servo (r-xp) 6.58: - [heap] (rw-p) 5.36: - other 3.51: - /usr/lib/x86_64-linux-gnu/dri/i965_dri.so (r-xp) 1.33: - /lib/x86_64-linux-gnu/libc-2.19.so (r-xp) 0.93: - /home/njn/moz/servo/components/servo/target/servo (r--p) 0.76: - /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 (r-xp) 0.74: - /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (r-xp) 0.50: - /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (r-xp) 0.50: - /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1 (r-xp) 0.45: - /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 (r-xp) 0.43: - /lib/x86_64-linux-gnu/libm-2.19.so (r-xp)
* Switch ordering of the memory profiler's output columns.Nicholas Nethercote2015-02-231-3/+3
| | | | | Because _size_ is always small, but _category_ can be long, so it makes sense to have the _size_ on the left.
* Cleanup memory.rs a bit.Ms2ger2015-02-131-10/+18
|
* auto merge of #4917 : nnethercote/servo/fix-jemalloc-reporting, r=jdmbors-servo2015-02-131-9/+23
|\ | | | | | | | | It turns out you need to send an "epoch" request to jemalloc before asking for a measurement otherwise you get stale data! Heavens.
| * Fix jemalloc memory measurements.Nicholas Nethercote2015-02-121-9/+23
| | | | | | | | | | It turns out you need to send an "epoch" request to jemalloc before asking for a measurement otherwise you get stale data! Heavens.
* | Fix warnings in util.Ms2ger2015-02-131-1/+1
|/
* Upgrade to rustc ba2f13ef0 2015-02-04Simon Sapin2015-02-111-3/+3
|
* Use mallinfo() to report the system heap size on Linux.Nicholas Nethercote2015-02-051-15/+61
| | | | | | Although Rust allocations are on the jemalloc heap, allocations done by Skia and the graphics driver are on the system heap, so it's worth reporting that as well.
* add `unwrap` to `send/recv` callsAlexandru Cojocaru2015-02-031-1/+1
|
* Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.Josh Matthews2015-01-281-10/+14
|
* Pass a String to spawn_named.Ms2ger2015-01-211-3/+4
| | | | | IntoString has been removed from Rust, and named() will take a String, so there is no good reason to do otherwise here.
* Fix `renamed to into_inner()` warningsMatthew Rasmus2015-01-081-1/+1
|
* Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d.Ms2ger2014-12-171-9/+9
|
* Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8aJack Moffitt2014-11-131-3/+2
|
* Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)Keegan McAllister2014-09-201-3/+4
|
* Cargoify servoJack Moffitt2014-09-081-0/+209