Today I took the memory use analysis from
and started fixing the things I noticed.
First I changed the text embedded in icons so that we only read 10×5
characters normally, and re-read more only when icons are larger than
“normal”. Then I changed the PangoLayout handling in the icon
container so that PangoLayouts are cached only for icons that are
visible in the view.
I also made the icon cache a bit more aggressive in getting rid of old
old cached icons. We now free most of the cache when Nautilus has been
idle for some time. We didn’t use to do this, which means that the
cache could use quite some memory if the last thing you did was visit
a directory with lots of thumbnailed files.
With the testcase of just starting Nautilus, displaying my homedir in
a spatial icon-view window we had this before:
[alex@greebo tests]$ ./analyze-memdump -s nautilus_before.dat total size: 4848501 unknown type: 1536818 strings: 904063 objects: 459112 slice: 517976 list headers: 137776 pixbuf data: 1292756
And, after applying the patches:
[alex@greebo tests]$ ./analyze-memdump -s nautilus_after.dat total size: 3787194 unknown type: 1019389 strings: 503273 objects: 452672 slice: 399168 list headers: 119936 pixbuf data: 1292756
So, for this usecase we saved about one megabyte of heap. Not
bad. Furthermore, when you close the window most of the pixbuf data will be freed after a while.
All of this is commited to CVS, please test it out and report any