Bug 675216 - Update about:memory's description of heap-committed. rs=njn
☠☠ backed out by 9d51886d4462 ☠ ☠
authorJustin Lebar <justin.lebar@gmail.com>
Sat, 06 Aug 2011 11:01:36 -0400
changeset 73959 5561bb7124db7b885ec958502d7115261b8f7a2f
parent 73958 ef7d25a5bb355e4caa78c0ca066de1c1b1fa9a23
child 73960 9d51886d4462341d4ae04ff97a7abde203789c3a
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersnjn
bugs675216
milestone8.0a1
Bug 675216 - Update about:memory's description of heap-committed. rs=njn
xpcom/base/nsMemoryReporterManager.cpp
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -303,26 +303,24 @@ static PRInt64 GetHeapDirty()
     return (PRInt64) stats.dirty;
 }
 
 NS_MEMORY_REPORTER_IMPLEMENT(HeapCommitted,
     "heap-committed",
     KIND_OTHER,
     UNITS_BYTES,
     GetHeapCommitted,
-    "Memory mapped by the heap allocator that is committed, i.e. in physical "
-    "memory or paged to disk.  The allocator may map blocks of many pages and "
-    "then hand out only some of those pages in response to a call to malloc. "
-    "Only those pages which have been handed out to the application are counted "
-    "as committed -- the OS lazily assigns physical pages to mappings, so those "
-    "pages which the allocator has not handed out haven't been written to and "
-    "therefore don't have a corresponding physical page.  (Of course, the "
-    "application may malloc pages and free them without ever writing to the "
-    "pages and causing them to be committed.  But the allocator conservatively "
-    "assumes that the application writes to all pages it receives.)")
+    "This number reported only for completeness; it is not particularly "
+    "meaningful. On Windows, all mapped memory is committed (because jemalloc's "
+    "MALLOC_DECOMMIT flag is set). Thus heap-committed should equal "
+    "heap-allocated + heap-unallocated. Elsewhere, jemalloc uses "
+    "madvise(DONT_NEED) to instruct the OS to drop the physical memory backing "
+    "pages the allocator doesn't need.  In this case, jemalloc counts the memory "
+    "as 'committed', but it's not taking up any space in physical memory or in "
+    "the swap file.");
 
 NS_MEMORY_REPORTER_IMPLEMENT(HeapDirty,
     "heap-dirty",
     KIND_OTHER,
     UNITS_BYTES,
     GetHeapDirty,
     "Memory mapped by the heap allocator that was once part of an allocation "
     "but which is now not allocated to the application.  Since the application "