Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Clear Tomcat Classloader cache?

Thread view: 
tkonrath@gmx.at - 04 Apr 2007 12:44 GMT
Hi.

As fas as I know, the classloader of the tomcat server caches all
classes, which has been requested once, in the ram. Further request do
not read the file from disk, they are using the information in the
ram.

We want to clear this cache or force the classloader, do read the
class-files (and any other ressource files) once again from disk,
without rebooting the server or restarting the webapp.

Is this possible?

Thanks for help.

Thomas Konrath
Tom Hawtin - 04 Apr 2007 13:28 GMT
> We want to clear this cache or force the classloader, do read the
> class-files (and any other ressource files) once again from disk,
> without rebooting the server or restarting the webapp.

That's effectively what restarting the webapp does. What are you trying
to achieve that is different?

Tom Hawtin
Esmond Pitt - 05 Apr 2007 01:33 GMT
That's not just the Tomcat classloader, that's *any* classloader. The
only way to achieve what you want is to use a new classloader. And the
only way to achieve that in Tomcat AFAIK is to restart the webapp.
Cheng Wei Lee - 30 Apr 2007 03:36 GMT
On 4 abr, 04:44, tkonr...@gmx.at wrote:
> Hi.
>
[quoted text clipped - 12 lines]
>
> Thomas Konrath

I think what you meant to do is to reload the context of your
application after your classes have been updated. To do so, go to
Tomcat Manager and restart your context. Beaware that the classes stay
in the Permanent Generation so they will eventually fill up the
Permanent generation Heap space, which means that you will eventually
have to restart Tomcat or you will run out of memory.

Cheng
tkonrath@gmx.at - 02 May 2007 07:52 GMT
> On 4 abr, 04:44, tkonr...@gmx.at wrote:
>
[quoted text clipped - 23 lines]
>
> Cheng

Hi.

Thanks for your replies.

The background of my question was just do be able to replace class-
files or other ressource files while tomcat is sill running and all
user sessions keep alive.  Restarting the webapp has two negative
aspects: 1) all user sessions would be lost and 2) as you mentioned,
tomcat will run out of memory.

So we have to think of another way to solve our problem.

Thanks for help

Thomas


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.