Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does Tomcat load classes twice when they are in different apps?

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
just a question for my understanding: We use a little framework for our apps (comes with a lot from the Apache site and some stuff from a vendor and some stuff from us). So all apps share 80% of the classes used.
When creating the WAR file I always include the full set of classes, since I can't know if the stuff is already there. In terms of diskspace that is stupid (however how many GB can you buy for 1h of tech-support ;-) ).
Is it also stupid in terms of resource useage? Will Tomcat (5) load a class twice if it is identical, but stored twice in different directories?
I know we could deploy the common classes into /common/lib. But then we might interfere with other apps?
What is a good deployment strategy. I think if Tomcat is smart enough about the classes, our current approach is fair enough?
;-) stw
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a discussion of classloaders in Tomcat 5 here.
It looks to me like that page covers your question.
Bill
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William,
thx for the URL... and shame on me, I've overlooked the ..How To page!
;-) stw
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic