[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: On Memory consumption of KDevelop-PG
From:       Milian Wolff <mail () milianw ! de>
Date:       2009-12-19 3:36:26
Message-ID: 200912190436.26313.mail () milianw ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Saturday 19 December 2009 03:50:01 Milian Wolff wrote:
> Hey all!
> 
> I did a massif run with duchainify on Mediawiki, and well as far as I can
>  see there is no apparent memory leak.
> 
> http://mwolff.pastebin.com/f3581a8d6
> 
> What bugs me is the peak... See also:
> http://mwolff.pastebin.com/f4a66d631
> 
> I mean, it's pretty clear why we have a pretty high memory consumption:
> 
> - every visited node gets an Ast, even those that are just general helpers
> (AST == Tree.. duh)
> 
> - every Ast has two qint64 + a pointer _at least_, meaning: sizeof(AstNode)
>  == 32, most "specialized" nodes have at least one pointer to a child
>  element, so lets say sizeOf(node) = 36
> 
> - the phpfunctions file alone has 1.5 mio nodes (and this file is pretty
>  simple imo, no logical expressions or stuff like that which will likely
>  blow up the node number greatly, I mean the massif peak is somewhere
>  later, dunno how to find the exact file... but it's _not_ the internal
>  file)

It's mediawiki/includes/ZhConversion.php

Basically one frikkin huge array that maps multibyte chars as far as I can 
see... It's ~380K big, has nearly 17k lines... And it has 11.7 mio nodes 
according to my callgrind output (number of times Php::Visitor::visitNode gets 
called).

380k vs.

99.01% (145,951,541B) (heap allocation functions) malloc/new/new[], --alloc-
fns, etc.
->60.70% (89,478,400B) 0x1720D04A: KDevPG::BlockType::init(int) (kdev-pg-
memory-pool.h:46)

Imo ridiculous... 

-- 
Milian Wolff
mail@milianw.de
http://milianw.de

["signature.asc" (application/pgp-signature)]

-- 
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic