users@glassfish.java.net

shared memory under glassfish / jvm

From: Mathijs Kwik <bluescreen303_at_gmail.com>
Date: Mon, 11 Jan 2010 09:18:01 +0100

Hi all,

I know that all applications running on glassfish have their own
virtual machine to run in.
I have many apps that use the same libraries (.jar), which they
contain in the .war file.
Does glassfish or the underlying JVM somehow detect this and share the
library in memory?
Or do they all have their own private copies in memory?

Does it help (memory-usage wise) to store those .jar files in a shared
library directory and list them under "libraries" when deploying? (so
glassfish will know for sure they are the same versions)

What about the ruby container?
It needs to have a jruby home (single jruby installation).
Does this get shared (memory-wise) by all jruby applications?
If I use .war-based deployment for ruby apps (just using the web
container), warbler includes a copy of the jruby .jar in all .war
files.
Will that take up more memory (1 complete jruby instance per app) than
using the ruby container?

Thanks,
Mathijs