RE: Memory Usage/Common Lib

2004-03-10 Thread Shapira, Yoav

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]



RE: Memory Usage/Common Lib

2004-03-10 Thread Ralph Einfeldt

Scenario 1 will use more memory than scenarion 2.

The ratio depends on the internal architecture of the classes.
(What kind of object they create, where they store it)

If you just look at the core size that is needed to load
the classes it roughly directly proportional to the number
of webapp in scenario 2. But apart from that most classes 
need additional memory. 

(If the libray store all object in the session, the storage
for this would change for both variants. If they store it 
in the classes it will make a difference)

 -Original Message-
 From: Lipov, Felix [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 10, 2004 2:55 PM
 To: Tomcat Users List
 Subject: Memory Usage/Common Lib
 
 
 I have application a, b, c. Each application uses x.jar, y.jar and
 z.jar.
 
 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.
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]