Clear Tomcat Classloader cache?

Discussion in 'Java' started by tkonrath@gmx.at, Apr 4, 2007.

  1. Guest

    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
     
    , Apr 4, 2007
    #1
    1. Advertising

  2. Tom Hawtin Guest

    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
     
    Tom Hawtin, Apr 4, 2007
    #2
    1. Advertising

  3. Esmond Pitt Guest

    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.
     
    Esmond Pitt, Apr 5, 2007
    #3
  4. On 4 abr, 04:44, 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
     
    Cheng Wei Lee, Apr 30, 2007
    #4
  5. Guest

    On Apr 30, 4:36 am, Cheng Wei Lee <> wrote:
    > On 4 abr, 04:44, 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
     
    , May 2, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. Miguel

    classloader in tomcat

    Mr. Miguel, Jul 11, 2003, in forum: Java
    Replies:
    2
    Views:
    601
    Miguel De Anda
    Jul 14, 2003
  2. Replies:
    5
    Views:
    695
    Nigel Wade
    Jul 15, 2003
  3. Mikito Harakiri

    Tomcat ClassLoader/Compile nightmare

    Mikito Harakiri, Nov 6, 2003, in forum: Java
    Replies:
    0
    Views:
    333
    Mikito Harakiri
    Nov 6, 2003
  4. Mark F

    Tomcat classloader problem

    Mark F, Mar 5, 2004, in forum: Java
    Replies:
    0
    Views:
    484
    Mark F
    Mar 5, 2004
  5. Moiristo

    Tomcat classloader

    Moiristo, Jun 21, 2006, in forum: Java
    Replies:
    0
    Views:
    329
    Moiristo
    Jun 21, 2006
Loading...

Share This Page