[fedora-java] Re: .jar and .so both loaded?

Peter Backlund peter.backlund at home.se
Thu Jul 14 13:58:01 UTC 2005


tor 2005-07-14 klockan 10:42 +0100 skrev Andrew Haley:
> Peter Backlund writes:
> 
>  > I have a couple of questions about class loading in natively compiled
>  > Java applications: should an application that has been natively compiled
>  > (i.e. all .jars compiled into .so by gcj and a .db created, according to
>  > http://gcc.gnu.org/wiki/How%20to%20BC%20compile%20with%20GCJ) load both
>  > the .jars and the .so into memory? lsof seems to think that is the
>  > case.  
> 
> Yes.
> 
>  > Also, Eclipse in Rawhide consumes almost twice as much memory for
>  > starting up and opening HelloWorld.java as the Sun JVM 1.5.0_03/upstream
>  > Eclipse combination.
> 
> Yeah, we know.  It's something we need to investigate and fix.

My point was that the excessive memory usage might be due to the fact
that both .jar and .so  files are loaded into memory. Why is the
bytecode needed at all when there are pre-compiled shared libraries with
the same code already available? 

>  > Is it still possible to build a Java application into a standalone
>  > executable, that does not require gij to run? Is there any guilde on how
>  > to do that?
> 
> As far as I'm aware it's all in the manual.

Well, of course, but I was looking for something a little more
high-level, maybe a tutorial on how to convert a semi-big Java
application into a native executable + shared libs. Anyway, I'll figure
it out. 

Do you lose the ability to load Java bytecode during runtime when
compiling it as a native executable?

/Peter





More information about the java-devel mailing list