The attached data shows what ends up in memory after loading www.cnn.com
in gtkEmbed, which has been purported to be a real browser buster.
- The first column shows the `type' of object that is consuming memory,
where types are computed using RTTI, or inferred from stack traces using
the rules in
http://lxr.mozilla.org/mozilla/source/tools/trace-malloc/types.dat
- The next two columns show `baseline' information of what's in memory
after starting gtkEmbed: the count of each type of object, and the
number of bytes that the objects occupy.
- The next two columns show information about what's in memory once
www.cnn.com has loaded. Again, count of object and number of bytes that
the objects occupy.
- The next three columns show the delta, subtracting the baseline from
the `after' data.
The data is sorted by the largest delta in bytes.
The good news is that this confirms some anectodal information that
we've had:
- Images and imagelib account for almost 1/4th of the memory
- The style system accounts for another 1/4th of the memory
I was a bit surprised to see that
- PresShell (including its hashtables) was so expensive, at about 8% of
the memory, or almost 300KB. That seems pretty big!
- nsFontMetricsGTK (including the data that is allocated to support it)
accounts for almost 5% of the memory. Why do we keep ~150KB of font
metrics data around?
- nsSocketTransport accounts for almost 5% of the memory. I would've
thought any large buffers allocated during the load would go away after
we'd finished loading the page!
Anyone care to vend me a clue?
chris
---- Base ---- ---- Incr ---- ----- Difference ----
Type Count Bytes Count Bytes Count Bytes %Total
TOTAL 40241 1940945 73545 5315142 33304 3374197 100.00
nsStyleContextData 126 96264 1147 876308 1021 780044 23.12
nsImageGTK 16 106824 151 832816 135 725992 21.52
PresShell 16 51088 198 340706 182 289618 8.58
imglib-unclassified 71 3921 683 165158 612 161237 4.78
nsSocketTransport 4 8593 60 154386 56 145793 4.32
nsFontMetricsGTK 190 22915 1147 161157 957 138242 4.10
nsString 648 15721 3885 142571 3237 126850 3.76
JS-unclassified 4582 154317 6918 245008 2336 90691 2.69
nsTextNode 172 10320 1444 86640 1272 76320 2.26
nsPersistentProperties 1716 53184 5919 129458 4203 76274 2.26
HTMLAttributesImpl 181 7108 2255 79124 2074 72016 2.13
StyleContextImpl 126 7560 1148 68880 1022 61320 1.82
nsSupportsArray 185 11352 1324 61912 1139 50560 1.50
nsVoidArray 578 18536 1948 68324 1370 49788 1.48
nsHTMLValue 53 3076 821 49730 768 46654 1.38
X-unclassified 2894 70890 3449 113771 555 42881 1.27
nsCSSRule 503 39980 913 72780 410 32800 0.97
nsFontGTK 43 18700 323 49856 280 31156 0.92
gtk-unclassified 803 93563 1189 123172 386 29609 0.88
OTHER 27334 1147033 38623 1493385 11289 346352 10.26