[Bug preprocessor/17798] [3.4/4.0 Regression] high cpp memory usage with undefined symbols
neil at daikokuya dot co dot uk
gcc-bugzilla@gcc.gnu.org
Tue Dec 14 13:57:00 GMT 2004
------- Additional Comments From neil at daikokuya dot co dot uk 2004-12-14 13:57 -------
Subject: Re: [3.4/4.0 Regression] high cpp memory usage with undefined symbols
pinskia at gcc dot gnu dot org wrote:-
>
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-14 05:53 -------
> The first thing is that read_file_guts mallocs the whole file which seems wrong. That accounts for
> 500M.
> The next problem is that keep every identifier we parsed even though we don't need it.
> 3014 calls for 12,273,008 bytes: thread_a000a1ec |0x0 | _dyld_start | _start | main | toplev_main |
> do_compile | compile_file | c_common_parse_file | c_parse_file | yyparse | yylex | _yylex | c_lex |
> c_lex_with_flags | cpp_get_token | _cpp_lex_token | _cpp_handle_directive | do_ifdef | lex_macro_node
> | _cpp_lex_token | _cpp_lex_direct | lex_identifier | ht_lookup_with_hash | _obstack_newchunk |
> xmalloc | malloc | malloc_zone_malloc
>
> And this is where the problem comes from.
> No there is no leak we keep a reference to all of thes identifiers but this seems like we should not.
Not doing either of these involves a major rework of cpplib FWIW.
I happen to think it would be beneficial, but I also think that the
whole approach CPP takes needs rethinking.
Neil.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17798
More information about the Gcc-bugs
mailing list