Hi,
Scenario 1:
Each application is deployed with the three jars under their respective
WEB-INF/lib directories.
Scenario 2:
Nothing is placed in the respective WEB-INF/lib directories. Rather the
three jars are placed in tomcat's common/lib directory.
Would the memory usage of tomcat differ in the two cases? I'm assuming
yes, since in the first case the classes need to be loaded three times
more. In the second scenario, the classes from the jars would only be
loaded up once. Therefore Scenario 1, in terms of memory allocated to
the classloaded would be 3x more? I would like to get some feedback to
confirm or deny this.
You're just about right. The memory allocated to the classloaders would
be 3x more, as they must be separate and can have no overlap. However,
in most real-life scenarios the independence and portability obtained by
the WEB-INF/lib setup is far more valuable than the minor memory cost.
I say minor even though it's 3x because it's 3x only for classes loaded,
not the heap, which usually dwarfs the classloader memory by orders of
magnitude.
Yoav Shapira
This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged. This
e-mail is intended only for the individual(s) to whom it is addressed, and may not be
saved, copied, printed, disclosed or used by anyone else. If you are not the(an)
intended recipient, please immediately delete this e-mail from your computer system
and notify the sender. Thank you.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]