Re: java custom build
timprepscius wrote:
I am using java's jvm inside an application to run custom scripts,
however the load time of the jvm is too slow.. I'm guessing this is
from all of the libraries being loaded etc.
Does anyone know of any existing projects that either provide a
slimmed down java jvm which only loads necessary libraries?
By and large, the JVM doesn't load a class until it's
referenced -- so pretty much everything that's loaded is in
fact "necessary." Try passing command-line options to the
JVM to get it to list out the classes as they're loaded; I
think you'll find that there are few if any you could do
without.
Or does anyone know of a micro jvm that provides JNI?
Or does anyone have any ideas on speeding up the jvm load time? (I
cannot pre-load stuff)
I need it to be under a half second, better under a quarter second.
If your script looks like "Start a JVM to run class C1
and exit, then start another JVM to run class C2 and exit ..."
you may be able to do better by starting just one JVM and
then calling C1.main(), C2.main(), ... instead. You wouldn't
want these classes calling System.exit() or doing similar
unfriendly things, so you should do a code review of all the
Cx and/or run each class with a SecurityManager, the way
browsers do.
--
Eric Sosman
esosman@ieee-dot-org.invalid