CSSStyleSelector::appendAuthorStylesheets was introduced in r104060 bug #75508 I was investigating total memory usage with Freya tool (http://webkit.sed.hu/blog/20091127/new-tool-extract-meaningful-memory-consumption-values-valgrind-shines-again) and I found that calling Vector's shrinkToFit method generates a lot of memory usage. shrinkToFit function call of appendAuthorStylesheets is accountable for 5.6 megabytes total memory allocation while it has only 452 kbytes peak. My question: is it necessary to call shrinkToFit in appendAuthorStylesheets? If it is then do you have any idea about a lazy-calling way?
Calling shrinkToFit just moves the memory usage from one function to another. It reduces overall consumption by minimizing the wasted space in the vector. Based on the information given this is not a bug.