Bug 109833 - Parsing special C++ header file lets kdevelop eat up all RAM & get killed
Summary: Parsing special C++ header file lets kdevelop eat up all RAM & get killed
Status: RESOLVED DUPLICATE of bug 96909
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 3.2.2
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-29 14:44 UTC by Mark Doll
Modified: 2013-03-31 00:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Pyhton generator script (23.65 KB, text/plain)
2005-07-29 14:46 UTC, Mark Doll
Details
pyhton generator script (23.65 KB, text/x-python)
2005-07-29 14:57 UTC, Mark Doll
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Doll 2005-07-29 14:44:27 UTC
Version:           3.2.2 (using KDE 3.4.2, Kubuntu Package 4:3.4.2-0ubuntu0hoary1 )
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2)
OS:                Linux (i686) release 2.6.10-5-386

Kdevelop consumes too much RAM when importing the C++ header file ~/libxorp/callback_debug.hh from the XORP 1.1 release (http://xorp.org/downloads.html) into a project (Menu Project->Import). It seems that kdevelop does not crash, but it consumes so much RAM when importing header files with many template parameters, that it eats up all RAM of a "normal PC",  which "only" have a few GiB of RAM.

This header file is generated with the pyhton script ~/libxorp/callback-gen.py (see comment at the top of the file):

python callback-gen-py -d -b 6 -l 15 > callback_debug.hh

kdevelop has no problems opening/highlighting the file without import into a project, nor has it problems with the non-debug version ~/libxorp/callback_nodebug.hh, (generated as above, but without option -d).

I've played a bit with the generator script. On my notebook (Pentium M 2 GHz, 1 GiB RAM, 2 GiB swap) I was able to import a header file generated with parameters up to b=l=6, or up to b=2 and l=16, which both consume about 2 GiB of virtual RAM during parsing. It took e few minutes to parse the file. After parsing, the memory consuption falls back to normal levels (about 150 MiB).
Comment 1 Mark Doll 2005-07-29 14:46:44 UTC
Created attachment 11982 [details]
Pyhton generator script

used to generated callback_debug.hh
Comment 2 Mark Doll 2005-07-29 14:57:02 UTC
Created attachment 11983 [details]
pyhton generator script

generates callback_debug.hh, callback_nodebug.hh
Comment 3 Mark Doll 2005-07-29 15:00:54 UTC
Comment on attachment 11982 [details]
Pyhton generator script

wrong mime type
Comment 4 Mark Doll 2005-07-29 15:04:49 UTC
Comment on attachment 11983 [details]
pyhton generator script

use

python callback-gen.py -d -b 6 -l 15 > callback_debug.hh

python callback-gen.py -b 6 -l 15 > callback_nodebug.hh
Comment 5 Mark Doll 2005-07-29 15:29:06 UTC
callback_debug.hh is too big (1,8 MiB) to be attached, but to give an impression of the generated classes, here are the last few lines of callback_debug.hh:

/**
 * Factory function that creates a callback object targetted at a
 * const member function with 15 dispatch time arguments and 6 bound arguments.
 */
template <class R, class O, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class BA1, class BA2, class BA3, class BA4, class BA5, class BA6> typename XorpCallback15<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15>::RefPtr
dbg_callback(const char* file, int line, O& o, R (O::*p)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, BA1, BA2, BA3, BA4, BA5, BA6) const, BA1 ba1, BA2 ba2, BA3 ba3, BA4 ba4, BA5 ba5, BA6 ba6)
{
    return XorpConstMemberCallbackFactory15B6<R, O, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, BA1, BA2, BA3, BA4, BA5, BA6, BaseAndDerived<CallbackSafeObject, O>::True>::make(file, line, &o, p, ba1, ba2, ba3, ba4, ba5, ba6);
}
Comment 6 Jens Dagerbo 2005-07-30 11:54:28 UTC
Dupe

*** This bug has been marked as a duplicate of 96909 ***
Comment 7 Aleix Pol 2013-03-31 00:45:46 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively