I ran this page and then fired up jvisualvm and took a "heap dump."
Go to the "Classes" view.  Find the java.lang.Thread class.  Click on
it and it will bring up a list of instances.  Go through them until
you find one with the name "Java2D Disposer" (#13 for me).  Then, look
for the field called "inheritableThreadLocals" and look in its "table"
field.  In there, you'll find a reference to the WicketApplication
object.  There's your leak!  The Java2D Disposer thread runs for the
duration of the VM and won't let go of that sucker.

On Tue, May 25, 2010 at 10:15 AM, James Carman
<ja...@carmanconsulting.com> wrote:
> Here's an example page that you can plug into a quickstart to show the bug:
>
> public class HomePage extends WebPage
> {
>    private static final long serialVersionUID = 1L;
>
>    static
>    {
>        System.out.println("I'm being initialized within the context
> of thread " + Thread.currentThread().getName() + ".");
>    }
>
>    public HomePage()
>    {
>        add(new Image("image", new MyImageResource()));
>    }
>
>    private class MyImageResource extends DynamicImageResource
>    {
>        private MyImageResource()
>        {
>            super("png");
>        }
>
>       �...@override
>        protected byte[] getImageData()
>        {
>            final BufferedImage bufferedImage = new BufferedImage(100,
> 100, BufferedImage.TYPE_4BYTE_ABGR);
>            Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics();
>            g2d.setPaint(Color.white);
>            g2d.fillRect(0, 0, 100, 100);
>            g2d.setPaint(Color.red);
>            g2d.drawOval(45, 45, 10, 10);
>            final ByteArrayOutputStream bout = new ByteArrayOutputStream();
>            try
>            {
>                ImageIO.write(bufferedImage, "png", bout);
>                bout.close();
>            }
>            catch (IOException e)
>            {
>                throw new WicketRuntimeException("Unable to render image.", e);
>            }
>            return bout.toByteArray();
>        }
>    }
> }
>
> On Tue, May 25, 2010 at 10:08 AM, Alex Objelean <alex.objel...@gmail.com> 
> wrote:
>>
>> Thanks!
>> It is enough for me. I'll do the rest from here..
>>
>> Alex
>>
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/vote-Revert-WICKET-2846-tp2226987p2230086.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>

Reply via email to