Re: Possible memory leak in Wicket 1.5.12

2014-12-21 Thread Francois Meillet
Hi Satrix, Make sure you remove the second constructor. (the one wih the inputstream argument) And the stream could be a local property (in the getImageData method) and not an instance property. François Meillet Formation Wicket - Développement Wicket Le 20 déc. 2014 à 14:26, Satrix a écr

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Looks like it's working now :) Thank you Francois for your help :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Possible-memory-leak-in-Wicket-1-5-12-tp4668856p4668874.html Sent from the Users forum mailing list archive at Nabble.com. -

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Francois Meillet
Moving the stream creation, opening and closing it in getImageData is a good thing. You should also remove the second constructor (with the inputstream argument). Now with your tests classes with the WicketTester, (you do have tests ;-) ), you can play yours pages with a debugger and see what h

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Actually I've checked the code in the second constructor and the stream is the ByteArrayInputStream instance. But I've moved the stream creation from the first constructor to the getImageData because that's the constructor I use to create the 99% of the images in my website. And yes I've changed i

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Francois Meillet
Can you show me the class when you open the stream ? Did you moved the stream creation to the getImageData this morning ? François Meillet Formation Wicket - Développement Wicket Le 20 déc. 2014 à 10:58, Satrix a écrit : > Hi, > > It's used very rarely so it should not be a problem. Howev

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Hi, It's used very rarely so it should not be a problem. However I've moved the stream creation from the constructor to getImageData method. The important point here - it only happens when the crawler visits my website. When normal users visit my website the file descriptors are closed successfu

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Francois Meillet
Hi Satrix, When the second constructor is used, with the inputsream argument, the stream is open. When this inputsream is opened ? François Meillet Le 20 déc. 2014 à 10:03, Satrix a écrit : > Yeah, sure. Here is the code: > > public class LocalFileResource extends DynamicImageResource {

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Yeah, sure. Here is the code: public class LocalFileResource extends DynamicImageResource { private final Logger LOG = Logger.getLogger(LocalFileResource.class); private String filePath; private InputStream stream; public LocalFileResource(String filePath) throws FileNotFound

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Francois Meillet
Can you show up the entire class ? François Meillet Formation Wicket - Développement Wicket Le 20 déc. 2014 à 09:56, Satrix a écrit : > Hi, > > It would be quite hard to reproduce the problem in quickstart application. > Here is the code of DynamicImageResource: > > @Override >protec

Re: Possible memory leak in Wicket 1.5.12

2014-12-20 Thread Satrix
Hi, It would be quite hard to reproduce the problem in quickstart application. Here is the code of DynamicImageResource: @Override protected byte[] getImageData(IResource.Attributes attributes) { try { return IOUtils.toByteArray(stream); } catch (IOException ex) {

Re: Possible memory leak in Wicket 1.5.12

2014-12-19 Thread Martin Grigorov
Hi, If you are able to reproduce this in a quickstart application then please create a ticket and attach it there. Thanks! Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Dec 19, 2014 at 6:02 PM, Satrix wrote: > > Hello, > > I've developed an Wicket website

Re: Possible memory leak in Wicket 1.5.12

2014-12-19 Thread Francois Meillet
Could you show us the code you use to serve these images ? François Meillet Le 19 déc. 2014 à 17:02, Satrix a écrit : > Hello, > > I've developed an Wicket website in Wicket 1.5.12. It's hosted on Glassfish > server 3.1.2.2 and lately I've run into the following problem: > > The problem o