My conclusion from your comment is that in order to communicate between multiple JVMs, all method calls become remote calls. Is "remote" referring to RMI ?
I'm not sure about the machanics of the communication between a server and webapps in their own JVM. It could be via RMI or could be as simlpe as passing on the HTTP request. As far as I see it, there would have to be some extra communication overhead though.
if we have multiple classloaders (i.e. multiple webapp contexts) running on one JVM; would that be more efficient in terms of memory usage than a solution with multiple JVMs -- assuming some finite amount of memory on the server.
I tend to think it would, since it is similar to the 'process versus
thread' argument. In a single JVM you have applications running as threads under a single process. The 'process footprint' only counts once. In addition, you only have to load the classes of 'library' style code like log4j, xml libraries etc once and they can be shared safely by all applications in the JVM. If you have multiple JVMs they each have to load these classes.
You may also find that Singleton classes no longer behave like Singletons since each JVM will probably have a copy loaded.
Is there an upper limit to accessible memory for the JVM
Each JVM would have to be defined a starting and maximum amount of memory it was allowed. (ie the '
java -X' options) Therefore yes, there would be a defined limit, since each JVM would have a pre-defined memory footprint.
What identifies a JVM instance ? If I have JVM1 and JVM2 running on a single machine, how do I differentiate between them ?
Dunno. I've seen people bring up similar issues, but I've never had to worry about it...
Dave