bug in inflate_free in inflate.c.

Maksim Lin maksim at swin.edu.au
Tue Dec 8 19:44:49 PST 1998


Thanks for the fix, I've wondered why kaffe took up heaps more memory
than the jdk.  Here are some (purely useless) numbers but they do show
the difference a few lines of code make :)

For simple awt frame with 1 button & 1 label:

JDK 1.1.7(+TYA JIT)	~4.6M
Kaffe (pre-bugfix):	~8.6M
Kaffe (post-bugfix):	~3.5M !!!

This is a big difference more my low-mem machine.

Maksim.

"Kim, Jongwon (freefish)" wrote:
> 
> I found a bug in inflate_free in inflate.c.
> In profiling Kaffe, I found Kaffe consumed about 4MB more memory
> for compressed class library than non-compressed.
> Kaffe doesn't free alloced memory for inflate.
> 
> Jongwon Kim
> 
> -----------------------------------------------------------------
> 
> int
> inflate_free(inflateInfo* pG)
> {
> #ifndef BUG_FIX
>   if (pG->fixed_tl != 0)
>   {
>     huft_free(pG->fixed_td);
>     huft_free(pG->fixed_tl);
>     pG->fixed_td = pG->fixed_tl = 0;
>     gc_free_fixed(pG->slide);
>   }
> #else
>   if (pG != 0) {
>    if (pG->fixed_tl != 0) {
>   huft_free(pG->fixed_td);
>   huft_free(pG->fixed_tl);
>    }
>      gc_free_fixed(pG->slide);
>    gc_free_fixed(pG);
>   }
> #endif
> 
>   return 0;
> }
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>     Kim, jongwon
> 
>     freefish at chollian.net
>     freefish at netsgo.com
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>   ------------------------------------------------------------------------
>                     Name: mem-usage.gif
>    mem-usage.gif    Type: GIF Image (image/gif)
>                 Encoding: base64

-- 
Maksim Lin
Open-Source:
IBM walks the walk
Sun talks the talk
Microsoft can't even think the thought - An anonymous coward on
slashdot.org


More information about the kaffe mailing list