Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Clear Tomcat Classloader cache?

Reply
Thread Tools

Clear Tomcat Classloader cache?

 
 
tkonrath@gmx.at
Guest
Posts: n/a
 
      04-04-2007
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

 
Reply With Quote
 
 
 
 
Tom Hawtin
Guest
Posts: n/a
 
      04-04-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
> 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
 
Reply With Quote
 
 
 
 
Esmond Pitt
Guest
Posts: n/a
 
      04-05-2007

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.
 
Reply With Quote
 
Cheng Wei Lee
Guest
Posts: n/a
 
      04-30-2007
On 4 abr, 04:44, (E-Mail Removed) wrote:
> 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


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

 
Reply With Quote
 
tkonrath@gmx.at
Guest
Posts: n/a
 
      05-02-2007
On Apr 30, 4:36 am, Cheng Wei Lee <(E-Mail Removed)> wrote:
> On 4 abr, 04:44, (E-Mail Removed) wrote:
>
>
>
> > 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

>
> 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


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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat classloader Moiristo Java 0 06-21-2006 02:26 PM
Tomcat classloader problem Mark F Java 0 03-05-2004 02:33 PM
Tomcat ClassLoader/Compile nightmare Mikito Harakiri Java 0 11-06-2003 11:10 PM
ClassLoader + tomcat read-the-signature@send-spam-to-dev-null.com Java 5 07-15-2003 01:28 PM
classloader in tomcat Mr. Miguel Java 2 07-14-2003 06:18 PM



Advertisments