Massif-Profiling Amarok

Alejandro Wainzinger aikawarazuni at gmail.com
Mon Sep 14 01:02:12 CEST 2009


Plagued by the question of why Amarok is using so much ram, I finally
ran massif on it.  I'll paste the relevant parts from the peak memory
usage point.

--------------------------------------------------------------------------------
  n        time(i)         total(B)   useful-heap(B) extra-heap(B)
stacks(B)
--------------------------------------------------------------------------------

 53  6,753,167,615       98,497,992       94,584,670     3,913,322            0


96.03% (94,584,670B) (heap allocation functions) malloc/new/new[],
--alloc-fns, etc.
->22.84% (22,497,280B) 0xA6E4682:
QScript::Buffer<QScriptValueImpl>::reserve(int)
(qscriptbuffer_p.h:139)
->22.84% (22,497,280B) 0xA6E4598:
QScript::Buffer<QScript::Member>::reserve(int) (qscriptbuffer_p.h:139)
->19.37% (19,080,864B) 0x5F24E31: qMalloc(unsigned long)
(qmalloc.cpp:55)
| ->11.50% (11,325,440B) 0xA6E42D8: QScript::MemoryPool::allocate(int)
(qscriptmemorypool_p.h:92)
->09.04% (8,906,267B) 0x1DC52546: my_malloc (my_malloc.c:34)
| |             ->06.96% (6,858,752B) 0x1DC0C435:
MySqlEmbeddedCollection::MySqlEmbeddedCollection(QString const&,
QString const&) (MySqlEmbeddedCollection.cpp:88)


In short: according to massif, of the roughly 100 mb of ram in usage
of an idle Amarok, about 65% of of that ram, about 65 MB of ram, is
being used up just by QScript.  I really hope I'm reading this wrong,
because _wow_ that is quite some overhead.  In comparison,
MySqlEmbedded, what I thought would have a huge impact, uses up a
measly 9 MB at maximum.  I do like the extensibility that scripting
adds to Amarok, but maybe we should investigate why it's using up so
much memory.

For reference, I've attached the massif output.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: massif.out.14909
Type: application/octet-stream
Size: 323523 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20090914/aba3eb0a/attachment-0001.dll 


More information about the Amarok-devel mailing list