Reducing footprint of libgcj?

Per Bothner per@bothner.com
Tue May 23 20:23:00 GMT 2000


"Stéphane Doyon" <s.doyon@videotron.ca> writes:
> My libgcj.so is about 1.5MB (stripped), plus libgcjgc and libzgcj... 
> We really do not have space for 2 more MB of shared libraries: 100-200K
> might be more in the acceptable range. Are there any
> simple compromises/sacrifices I could make to bring it down to that level?

The first question: Why are you using shared libraries on an
embedded platform? If you do static linking, the linker can throw
out classes that are never referenced. (There are some things
to be careful with, since the linker might throw out some classes
that you referenced using Class.forName, but there are ways to
handle that.)
Beyond that, one of the goals of libgcj is to support different
configurations. I.e. we want to be able to run configure
--without-XXX to leave out feature XXX. You might want to leave out
some of the information needed for reflection. Someone might want to
leave out support for internationalization. Etc. There are a lot of
possibilities here, but they may require some work. In C++ code
we can add conditional compilation to control features. In Java
it is difficult to leave out features selectively, but we can leave
out entire classes with appropriate Makefile tricks.
To clarify: I don't know the current status of what you can do
to reduce space with libgcj *as is*. However, there is a lot of
potential here, and we certainly want to make it easier to build
smaller and less feature-ful versions.
-- 
	--Per Bothner
per@bothner.com http://www.bothner.com/~per/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /