So, I'm trying to figure out how to most efficiently run a server-side Java application thousands of times a day.
AFAICT, the standard way things go... calling the Java app from the commandline with "java -jar [name of java app] [commandline modifiers for the app]" instantiates the JVM, then runs the app, then unloads both from memory.
Unfortunately, this feels a little sluggish, and if I had to do this thousands of times a day on a server, it feels like it could hamper overall server performance and maybe have some wear & tear issues on the disk.
One of the methods I looked into was using a compiler which takes the Java app and compiles it into a native executable for the system. Problem wth that is that this app needs access to fonts.
When you don't have a GUI like XWindows or Windows providing the font management and access, the JVM leaps into the breach. At least with Sun Java, you put the fonts into the right subdirectory of your JVM install, and away you go.
So compiling the app so it doesn't need the JVM/JIT to run it doesn't work because the app needs some services the JVM provides.
So, how do I speed things up?
One thought is to create a set of startup scripts that mount a RAMdisk, copy Java and the Java app over to the RAMdisk, then set the Java path to the instance on the RAMdisk. That way everything is loading from RAM instead of the hard drive, which speeds up the load and reduces drive wear and tear.
Another is to tell Sun to go take a leap, and use a third party JVM/JIT. This requires some testing to make sure the java app will run with it and it will provide the font services I need, but otherwise might further speed things up.
And, for the moment, those are all the ideas I have. They may well be boneheaded. Critiques, alternatives are welcome.