Re: CayenneServlet response appears not to be GC'ed

From: Marek Wawrzyczny (mare..sh.com.au)
Date: Tue May 16 2006 - 02:42:22 EDT

  • Next message: Mike Kienenberger: "Re: non-SQL query to find distinct relationships in an entity's table?"

    Ok, that was a silly question, I think I understand why we only have
    one servlet, amongst other things it is the glue between HttpSessions
    and ObjectContexts.

    On 16/05/2006, at 12:44 PM, Marek Wawrzyczny wrote:

    > Out of curiosity, I have noticed that there is only one instance of
    > the servlet created for all requests/responses. This one instance
    > is responsible for all communication between the server and clients
    > for the life of the server. Previous memory leak reports for Jetty
    > point to Loggers not being released at the correct points, but I
    > have been going through the source for both Hassian and Cayenne and
    > have found no evidence of any Loggers even existing in the code.

    > On 05/05/2006, at 1:29 AM, Andrus Adamchik wrote:
    >
    >> I suspect your sessions are not timing out. As SF anonymous CVS
    >> seems to be dead for good, I just moved the example code to Apache
    >> subversion [1]. There is a sample listener class,
    >> cayenne3t.example.util.SessionTracker, that debugs session
    >> deallocation. Timeout is controlled in web.xml via standard means:
    >>
    >> <session-config>
    >> <session-timeout>10</session-timeout>
    >> </session-config>
    >>
    >> [1] http://svn.apache.org/repos/asf/incubator/cayenne/examples/trunk/
    >>
    >> Andrus
    >>
    >> On May 4, 2006, at 3:59 AM, Marek Wawrzyczny wrote:
    >>
    >>> Hi all,
    >>>
    >>> We are getting close to releasing a preview version of our
    >>> software that utilizes Multi-tier Cayenne.
    >>> We have started to stress test it and we have hit a problem,
    >>> something on the server us consuming
    >>> memory and never releases it.
    >>> I tried profiling the server application and it appears that
    >>> RawData objects (our first hunch) on the
    >>> server are being GC'ed correctly. There is no indication of
    >>> excessive instances of any class, Cayenne
    >>> or not.
    >>>
    >>> The one thing not being monitored by the profiler is servlets.
    >>> Judging by the memory usage jumps,
    >>> I have a sneaking suspicion that it is the HessianServlet
    >>> responses that are not being GC'ed - the
    >>> increases seem to correspond to data requests.
    >>>
    >>> The particular piece of GUI tested fetches a list of ~25,000
    >>> records from a table into a shared context with
    >>> paging enabled, page size is 100 records.
    >>> The used memory in the JVM jumps by 30+ Mb as we traverse through
    >>> all the records. The JVM never
    >>> releases that memory.
    >>>
    >>> We have been through our code and we are definitely not keeping
    >>> any references to instances of
    >>> servlets, requests or responses.
    >>>
    >>> We are using Jetty as the server.
    >>>
    >>> I was hoping someone might have some pointers before I jump into
    >>> writing a profiling container for
    >>> the servlet. Any help appreciated.
    >>>
    >>>
    >>> Regards,
    >>>
    >>> Marek Wawrzyczny
    >>>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Tue May 16 2006 - 02:42:56 EDT