Tomcat JSP session beans not being removed at the end of the session

Discussion in 'Java' started by John Smith, Jul 15, 2004.

  1. John Smith

    John Smith Guest

    I am using Tomcat 4.0. I have a number of JSP beans with scope="session".
    The beans a simple and do not contain any circular references. When a
    session times out I have noticed the beans are not cleaned up. I have
    checked this by adding a finalize to the classes and this does not indicate
    them being removed.

    Any ideas?

    Thanks Jon
     
    John Smith, Jul 15, 2004
    #1
    1. Advertising

  2. On Thu, 15 Jul 2004 11:30:13 +0000 (UTC), John Smith
    <> wrote:

    > I am using Tomcat 4.0. I have a number of JSP beans with scope="session".
    > The beans a simple and do not contain any circular references. When a
    > session times out I have noticed the beans are not cleaned up. I have
    > checked this by adding a finalize to the classes and this does not
    > indicate
    > them being removed.
    >


    Are you sure that GC has been run? Invalidating a session just
    removes the reference, your finalize won't show up until GC runs.
    Bill
     
    William Brogden, Jul 15, 2004
    #2
    1. Advertising

  3. Re: Tomcat JSP session beans not being removed at the end of thesession

    John Smith wrote:
    > I am using Tomcat 4.0. I have a number of JSP beans with scope="session".
    > The beans a simple and do not contain any circular references. When a
    > session times out I have noticed the beans are not cleaned up. I have
    > checked this by adding a finalize to the classes and this does not indicate
    > them being removed.
    >
    > Any ideas?
    >
    > Thanks Jon


    Tomcat is made with java and like all java applications memory is freed
    by garbage collector and finalize method is called when gc is going to
    free object from memory. If you need information about when session is
    dying use javax.servlet.http.HttpSessionListener interface.

    - Sampsa

    --
    -------------------------------------------
    // Sampsa Sohlman //
    // My email can be found on my homepage //
    // http://sampsa.sohlman.com //
    -------------------------------------------
     
    Sampsa Sohlman, Jul 15, 2004
    #3
    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. xzzy

    DLL being removed from solution

    xzzy, Nov 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    569
  2. Andoni
    Replies:
    2
    Views:
    496
    Andoni
    Jul 16, 2004
  3. Torsten Schmeissel
    Replies:
    0
    Views:
    419
    Torsten Schmeissel
    Apr 29, 2005
  4. Replies:
    6
    Views:
    661
  5. tiewknvc9
    Replies:
    4
    Views:
    1,761
Loading...

Share This Page