users@glassfish.java.net

Re: Horrible, nasty memory leak in GFv2 when serving large PDFs

From: <glassfish_at_javadesktop.org>
Date: Sun, 28 Oct 2007 09:11:26 PST

Playing with the debugger, this is some kind of problem within Grizzly it seems (I was stepping through the stream writing code and I stopped when I bumped in to Grizzly channels).

Also I wrote a simple servlet:
[code]
        response.setContentType("application/pdf");
        OutputStream o = response.getOutputStream();
        
        FileInputStream is = new FileInputStream("/tmp/biggo.pdf");
        byte[] buf = new byte[8192];
        
        int l = is.read(buf);
        while (l > -1) {
            o.write(buf, 0, l);
            l = is.read(buf);
        }
        o.close();
        is.close();
[/code]

And this has the same behavior.

Is there a way I can disable Grizzly and go back to a more mundane (perhaps Coyote) connector? We're lucky to have a 1/2 dozen users, so any real Grizzly benefit is lost on us at this point, but serving up the large files is very important and a different connector may well get us over the hump while we wait for a fix (which I know Jean-Francois will fix quickly because, well, he's Jean-Francois!).

I also updated the issue as well, 3814.

Thanx!
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=242556