Jar Files and memory footprint...

Godmar Back gback at cs.utah.edu
Sat Jan 9 00:06:00 PST 1999


> Godmar, this may be the reason of enormouse
> memory usage for kiev compiler too, isn't it?
> We've fixed one memory leaking bug with zip files,
> and I get 50% of memory usage decrease.
> There may be another memory leak bug somewere
> there. Remember my statistic - it was
> 50-60 Mb for kaffe before bugfix and about 35 Mb
> after, while Sun spends only 8 Mb. I expect kaffe
> to spend not more 10-12 Mb normally, so, there
> must be another bug like that fixed one.

Actually, the way I interpret Amancio's numbers is that there may not
be a memory leak at all. 

Kaffe simply mmaps all the jar files it accesses, and such files
are never unmapped.  However, ps reports them as memory usage.

We could add a switch or option to kaffe that disables mmapping
jar files, at the costs of more system calls.  Remember that mmapping
jar files also helped us overcome the problems with not being able to 
use stdio when from these files.

I do not know enough about how various OSs actually implement mmap
to know whether mmapping files is costly.  However, in an OS like Linux
that integrates buffer cache and virtual memory, I don't see any reason
why we should bother to avoid mmap.  Some of the BSDs might be a slight 
disadvantage here.  If somebody has more insight in these matters, we'd
certainly like to know about it.  Also, I think in linux the /proc system
provides information about what regions of the virtual addr space of a
process are used.

We would certainly like to disable mmap on systems that merely fake it
by reserving memory and copying the data from the disk.

Jason Baker is working on further reducing the memory footprint of
kaffe.  The next target is the ridiculously large 10 byte per object 
overhead we are currently paying.

	- Godmar

More information about the kaffe mailing list