Commit Graph

258 Commits

Author SHA1 Message Date
Nicholas Nethercote
7c18c5d9da Bug 1249503 - Make WindowsAddressSpaceReporter bloat memory reports less. r=erahm.
The WindowsAddressSpaceReporter generates one memory report per segment, and
there can be 10,000+ segments.

This patch changes things so that one memory report is generated per segment
*kind* -- at most a couple of dozen -- rather than one per *segment*.
2016-02-23 18:39:24 +11:00
Kyle Huey
ce39f191af Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Felix Janda
f209e53e7f Bug 1203272 - Fix build of nsMemoryReporterManager on linux systems without mallinfo(). r=glandium,njn. 2016-01-01 11:10:54 +01:00
Eric Rahm
7e706942d8 Bug 1224685 - Add |resident-unique| measurement to Windows. r=njn 2015-11-13 13:44:48 -08:00
Eric Rahm
3307903169 Bug 1223927 - Add resident-unique measurement to OS X. r=njn 2015-11-11 14:07:30 -08:00
Nathan Froyd
9c5965b035 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Eric Rahm
448638c124 Bug 1194555 - Part 6: Run reporters asynchronously. r=njn,jld,ted 2015-10-14 16:52:59 -07:00
Eric Rahm
8bbde5b207 Bug 1194555 - Part 5: Add option for async memory reporters. r=njn 2015-10-14 16:52:58 -07:00
Eric Rahm
36f694bfa4 Bug 1194555 - Part 4: Rename GetReportsState PendingProcessesState. r=njn 2015-10-14 16:52:57 -07:00
Eric Rahm
fca53ac609 Bug 1194555 - Part 3: Remove |getReportsForThisProcess| from the nsIMemoryReporterManager interface. r=njn
|getReportsForThisProcess| differs from |getReports| in that it is limited to current process and is synchronous. When asynchronous memory reporters are added the function will no longer be able tobe synchronous. There isn't much utility in only measuring the current process, so we can remove the function and switch existing users to |getReports|.
2015-10-14 16:52:55 -07:00
Eric Rahm
98a6c69bfb Bug 1194555 - Part 2: Remove |explicit| attribute from nsIMemoryReporterManager. r=njn
The calculation of |explicit| relies on the synchronous |getReportsForThisProcess|, once we have asynchronous reporters this will no longer work. As it is currently referenced in the about::memory tests we can just remove it.
2015-10-14 16:52:54 -07:00
Eric Rahm
5844d55676 Bug 1194555 - Part 1: Remove RunReportersForThisProcess. r=njn
RunReportersForThisProcess is no longer used and will no longer work once we have async reporters.
2015-10-14 16:52:53 -07:00
Eric Rahm
b7fe470d7d Bug 1194555 - Part 0: Cleanup GetReportsState constructor. r=njn
Move GetReportsState ctor to the impl so that mChildrenPending doesn't have
to be heap allocated.
2015-10-14 16:52:52 -07:00
Wes Kocher
c6785e435b Backed out 7 changesets (bug 1194555) for xpcshell failures
Backed out changeset e77be333f4fb (bug 1194555)
Backed out changeset 11951462a37c (bug 1194555)
Backed out changeset 99b27aa952c5 (bug 1194555)
Backed out changeset 70a8ed3b6a45 (bug 1194555)
Backed out changeset 748bfebe81e7 (bug 1194555)
Backed out changeset cbaac05a2934 (bug 1194555)
Backed out changeset fcbfd1379fcd (bug 1194555)
2015-10-06 14:40:51 -07:00
Eric Rahm
98fe7788c7 Bug 1194555 - Part 6: Run reporters asynchronously. r=njn,jld 2015-10-06 11:23:36 -07:00
Eric Rahm
f2b2a50da6 Bug 1194555 - Part 5: Add option for async memory reporters. r=njn 2015-10-06 11:23:35 -07:00
Eric Rahm
7440eba788 Bug 1194555 - Part 4: Rename GetReportsState PendingProcessesState. r=njn 2015-10-06 11:23:34 -07:00
Eric Rahm
a911eaa772 Bug 1194555 - Part 3: Remove |getReportsForThisProcess| from the nsIMemoryReporterManager interface. r=njn
|getReportsForThisProcess| differs from |getReports| in that it is limited to current process and is synchronous. When asynchronous memory reporters are added the function will no longer be able tobe synchronous. There isn't much utility in only measuring the current process, so we can remove the function and switch existing users to |getReports|.
2015-10-06 11:23:33 -07:00
Eric Rahm
c53df066b3 Bug 1194555 - Part 2: Remove |explicit| attribute from nsIMemoryReporterManager. r=njn
The calculation of |explicit| relies on the synchronous |getReportsForThisProcess|, once we have asynchronous reporters this will no longer work. As it is currently referenced in the about::memory tests we can just remove it.
2015-10-06 11:23:32 -07:00
Eric Rahm
4f0682a3b9 Bug 1194555 - Part 1: Remove RunReportersForThisProcess. r=njn
RunReportersForThisProcess is no longer used and will no longer work once we have async reporters.
2015-10-06 11:23:31 -07:00
Eric Rahm
bf6c7af6ed Bug 1194555 - Part 0: Cleanup GetReportsState constructor. r=njn
Move GetReportsState ctor to the impl so that mChildrenPending doesn't have
to be heap allocated.
2015-10-06 11:23:30 -07:00
Mike Hommey
5cd6b3d15e Bug 1203840 - Trigger dirty pages purge after CC. r=njn,r=smaug,r=mccr8
Jemalloc 4 purges dirty pages regularly during free() when the ratio of dirty
pages compared to active pages is higher than 1 << lg_dirty_mult.  We set
lg_dirty_mult in jemalloc_config to limit RSS usage, but it also has an impact
on performance.

So instead of enforcing a high ratio to force more pages being purged, we keep
jemalloc's default ratio of 8, and force a regular purge of all dirty pages,
after cycle collection.

Keeping jemalloc's default ratio avoids cycle-collection-triggered purge to
have to go through really all dirty pages when there are a lot, in which case
the normal jemalloc purge during free() will already have kicked in. It also
takes care of everything that doesn't run the cycle collector still having
a level of purge, like plugins in the plugin-container.

At the same time, since jemalloc_purge_freed_pages does nothing with jemalloc 4,
repurpose the MEMORY_FREE_PURGED_PAGES_MS telemetry probe to track the time
spent in this cycle-collector-triggered purge.
2015-09-20 17:43:43 +09:00
Nicholas Nethercote
e37e6d5b06 Bug 1194061 - Implement "system-heap-allocated" reporter for Windows. r=dmajor. 2015-08-19 20:35:17 -07:00
Nicholas Nethercote
19405fbd7a Bug 828844 - Add a "system-heap-allocated" memory report on Linux. r=glandium.
This gives zero when jemalloc is enabled and non-zero when jemalloc is disabled
(e.g. I got 83 MiB at start-up, which sounds plausible).
2015-08-12 17:44:00 -07:00
Nate Hughes
b12d6d89f1 Bug 986302 - Add memory reporting for HPACK tables r=hurley r=njn 2015-07-17 14:38:10 -07:00
Carsten "Tomcat" Book
c70f141ba4 Backed out changeset 8b90b21e0c64 (bug 986302) for static build failures 2015-07-21 08:53:37 +02:00
Nate Hughes
0e64d8f9c5 Bug 986302 - Add memory reporting for HPACK tables. r=hurley r=njn 2015-07-17 14:38:10 -07:00
Ehsan Akhgari
56ebc421c6 Bug 1123386 - Part 3: Mark DoNothingCallback::Callback as override in order to fix a build issue in warnings as errors mode 2015-07-17 22:19:57 -04:00
Birunthan Mohanathas
e52329c788 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Nicholas Nethercote
1840f58314 Bug 1181445 (part 2) - Use nsTHashTable::Iterator in nsMemoryReporterManager. r=froydnj. 2015-07-08 22:32:39 -07:00
Jed Davis
3e8cb86ffa Bug 1154053 - Limit concurrency of e10s memory reporting. r=erahm
This changes the way nsMemoryReporterManger handles child processes;
instead of using an observer message and trying to keep a count of child
processes expected to answer, it directly iterates a copy of the list
of content processes and explicitly handles children which exit before
their reports start.

Note that GC/CC logs still run at full concurrency, and that no child
reports start until the parent is finished (see bug 1151597) regardless
of concurrency limit.
2015-05-06 20:51:00 +02:00
Phil Ringnalda
3fc48280b7 Back out e05936099653 (bug 1154053) on suspicion of causing the hellish frequency of Android 2.3 robocop-2 crashes that resulted in this CLOSED TREE, a=bustage 2015-05-07 22:41:26 -07:00
Jed Davis
f6d38c4cd3 Bug 1154053 - Limit concurrency of e10s memory reporting. r=erahm
This changes the way nsMemoryReporterManger handles child processes;
instead of using an observer message and trying to keep a count of child
processes expected to answer, it directly iterates a copy of the list
of content processes and explicitly handles children which exit before
their reports start.

Note that GC/CC logs still run at full concurrency, and that no child
reports start until the parent is finished (see bug 1151597) regardless
of concurrency limit.
2015-05-06 20:51:00 +02:00
Jed Davis
c038529a66 Bug 1151597 - Step 2: Don't start child process memory reports until parent is finished. r=erahm 2015-04-27 15:46:00 -04:00
Jed Davis
5cf29d8289 Bug 1151597 - Step 1: Change memory reporting IPC to send one report per message. r=erahm
Also fixes bug 1005154 -- since there's now a method for "end of report",
we might as well call it from ActorDestroy instead of Recv__delete__.
2015-04-27 15:45:00 -04:00
Jed Davis
72145bc9c8 Bug 1154041 - Enable child process memory report logging by default on B2G. r=erahm 2015-04-24 14:53:00 -04:00
Ehsan Akhgari
33bb32f549 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Nicholas Nethercote
b3230c7a24 Bug 1145007 (part 2) - Add a "resident-peak" distinguished amount and memory reporter on Unix. r=erahm. 2015-03-19 15:16:37 -07:00
Nathan Froyd
e9f067ac2a Bug 1141689 - use services::GetObserverService more; r=ehsan 2014-04-29 13:31:06 -04:00
Nicholas Nethercote
82523cb06a Bug 1138770 - Make memory reporters that have been stashed for testing eligible for unregistration. r=mccr8. 2015-03-02 18:55:42 -08:00
Nicholas Nethercote
84deec6147 Bug 1134030 - Add WindowsAddressSpaceReporter. code=njn,dmajor. r=dmajor,njn. 2015-02-20 13:13:16 +11:00
Daniel Holbert
7dec9ee7ed Bug 1125632 followup: Mark remaining CollectReports impls in nsMemoryReporterManager.cpp and SystemMemoryReporter.cpp as MOZ_OVERRIDE. 2015-01-27 09:48:54 -08:00
Daniel Holbert
fe7953382c Bug 1125632: Annotate ResidentUniqueReporter::CollectReports as MOZ_OVERRIDE. r=njn 2015-01-25 15:14:00 -08:00
Nicholas Nethercote
bf937eb0ab Bug 1121830 - DMD: add "num" property to blocks in the output. r=mccr8.
The new "num" property lets identical blocks be aggregated in the output. This
patch only uses the "num" property for dead blocks, because that's where the
greatest potential benefit lies, but it could be used for live blocks as well.

On one test case (a complex PDF file) running with --mode=cumulative
--sample-below=1 this patch had the following effects.

- Change in running speed was negligible.

- Compressed output file size dropped from 8.8 to 5.0 MB.

- Compressed output file size dropped from 297 to 50 MB.

- dmd.py runtime (without stack fixing) dropped from 30 to 8 seconds.

--HG--
extra : rebase_source : 46a32058cd5c31cd823fe3f1accb5e68bcd320f3
2015-01-15 20:38:38 -08:00
James Willcox
16dc163af8 bug 1118552 - fix gcc4.9 warnings on Android r=glandium 2015-01-06 22:20:46 -05:00
Ehsan Akhgari
4f80dee4e8 Bug 1117035 - Mark virtual overridden functions as MOZ_OVERRIDE in XPCOM; r=froydnj 2015-01-05 11:25:41 -05:00
Nicholas Nethercote
5cc6a39a9a Bug 1094552 (part 6) - DMD: add support for cumulative heap profiling. r=mccr8.
By adding a new "cumulative" mode.

--HG--
extra : rebase_source : 5c851b7c594a134fae48393ff0becfd057715041
2014-10-30 20:22:47 -07:00
Nicholas Nethercote
b79b7d305e Bug 1094552 (part 3) - DMD: rename |Block| as |LiveBlock|. r=mccr8.
This is to give better contrast with |DeadBlock|, which will be added in the
next patch.

--HG--
extra : rebase_source : cbc767fcc5667cfed108ca7c4ebf1d7e82aa185e
2014-11-18 18:57:20 -08:00
Nicholas Nethercote
91ccc1a10e Bug 1061024 (part 2) - Some minor DMD clean-ups. r=jld.
--HG--
extra : rebase_source : f780376e8803222c92a5a92bc4155600e068ce0c
2014-08-31 22:35:28 -07:00
Nicholas Nethercote
1e51d01858 Bug 1061024 (part 1) - Don't run DMD when about:memory's "Measure" button is pressed. r=jld.
--HG--
extra : rebase_source : ddf0236352c64eb9839dfd0a219451a568aba10e
2014-08-31 20:36:26 -07:00