Hi Hilton,

Thanks for the pointers. I'm pretty sure I have tracked down the leak, the 
problem is that I'm not sure what the code is supposed to be doing so I'm not 
sure what correction to make. For example, I think that changing the web.xml to 
remove the references to FORWARD and INCLUDE might solve the leak, but I don't 
know if that would pervert whatever the original intention of the code was.

Cheers, Robin.

Robin Taylor
Main Library
University of Edinburgh

________________________________
From: Hilton Gibson [hilton.gib...@gmail.com]
Sent: 25 March 2013 18:42
To: TAYLOR Robin
Cc: dspace-devel Developers
Subject: Re: [Dspace-devel] Memory leak in dspace-services

Perhaps using one of these will help: 
http://wiki.lib.sun.ac.za/index.php/SUNScholar/Optimisations#Java_Webapp_Performance


On 25 March 2013 17:28, TAYLOR Robin 
<robin.tay...@ed.ac.uk<mailto:robin.tay...@ed.ac.uk>> wrote:
Hi all,

I'm in search of help. We have been suffering from a memory leak recently 
causing out-of-memory exceptions and *I think* the cause is this:-

In DSpaceWebappServletFilter.doFilter() there is a call to 
requestService.startRequest() which in turn calls all registered 
RequestInterceptors, one of which is CachingServiceRequestInterceptor. This 
creates a 'cache map' for the current request. I assume the cache map should be 
removed when the request ends but that does not seem to be happening in all 
cases, causing the class CachingServiceImpl to grow inexorably until memory is 
exhausted. Going back to our starting point of 
DSpaceWebappServletFilter.doFilter() there is a call to 
requestService.endRequest() which should remove the cache map, but it does not 
appear to be invoked for all requests. Looking at web.xml for this filter I 
see...

 <filter-mapping>
      <filter-name>dspace.request</filter-name>
       <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
  </filter-mapping>

It looks like only 'real' requests get their cache tidied up and not those 
generated by FORWARD or INCLUDE.

So I think I know what is going wrong, but I don't know what is the right way 
to fix it. Any dspace-services experts out there able to help?

Cheers, Robin.

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Dspace-devel mailing list
Dspace-devel@lists.sourceforge.net<mailto:Dspace-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/dspace-devel



--
Hilton Gibson
Systems Administrator
JS Gericke Library
Room 1025D
Stellenbosch University
Private Bag X5036
Stellenbosch
7599
South Africa

Tel: +27 21 808 4100 | Cell: +27 84 646 4758
http://library.sun.ac.za
http://scholar.sun.ac.za
http://ar1.sun.ac.za
http://aj1.sun.ac.za

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Dspace-devel mailing list
Dspace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to