Massif-Profiling Amarok

Ian Monroe ian.monroe at gmail.com
Mon Sep 14 10:10:55 CEST 2009


On Sun, Sep 13, 2009 at 6:02 PM, Alejandro Wainzinger
<aikawarazuni at gmail.com> wrote:
> 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.

That doesn't really surprise me given how huge the qtscript extension
.so's are.

A couple of weeks ago I started looking into creating the Qt binding
for QtScript using Smoke. I think it could work. I have some prototype
code up in my personal gitorious. I should probably keep the PS3 off
and get back to work on this. :)

I had gotten to the point where I could see it was feasible to do, but
could also see that it would be quite a bit of work. Thanks for giving
some new incentive. :)

Ian


More information about the Amarok-devel mailing list