Constant pool optimization

Maxim Kizub max at immsp.kiev.ua
Thu Jan 28 18:13:14 PST 1999


Well, but CONSTANT_String is optimized
as pointer to Hjava_lang_String, CONSTANT_Class as
Hjava_lang_Class*, methods and fields - as pointers
to Method* & Field* and so on... Isn't it?


Godmar Back wrote:
> 
>  How do you implement reflection after you've removed
> most of the utf8constants?
> 
>         - Godmar
> 
> >
> > Hello.
> >
> > Looking at memory profile made by per-method basis,
> > I was impressed how mach of memory takes constant
> > pool.
> >
> > I my case that was 530 kb!
> >
> > I think, there is one possible quick improvement.
> > since all CONSTANT_Utf8 constants are not used
> > directly, we may simply remove them, after
> > class file parsing.
> >
> > If I'm not wrong, javac & kiev sorts constant
> > pool to put all utf8 constants at the bottom
> > of the pool. It's possible to simply delete the
> > tail of the pool in most cases. This may reduse
> > the size, allocated by CP about 2 times, especially,
> > if classes were genereted with debug info (-g switch).
> >
> > I think, a couple lines of code may save about 200 kb
> > for big programs.
> >
> > Regards
> >   Maxim Kizub
> >
> >


More information about the kaffe mailing list