Hi all,

I've come across a memory leak with Pixbuf - whenever I construct one,
lots of memory is leaked. The test below leaks ~200MB when loading a
6kb image 10,000 times. Commenting out the Pixbuf construction leads
to steady memory use.
This memory usage isn't reported by the JVM.  I've come across this
behaviour with 4.0.19 and 4.1.1.

Whilst I'd love a proper solution to this, I wonder if anyone has a
quick and dirty workaround for freeing up this memory? I'm doing a
production run of approximately 6000 maps for a website, which grinds
to a halt after 100 or so maps, using all 8GB of RAM.

Thanks

Will Temperley


  @Test
  public void itLeaks() throws IOException {
    Gtk.init(null);

    for (int i = 0; i < 10000; i++) {
      System.out.println(i);

      BufferedImage b = ImageIO.read(new File("/tmp/x.png"));
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      ImageIO.write(b, "PNG", bos);
      byte[] arr = bos.toByteArray();

      //comment out and memory usage remains steady
      Pixbuf pb = new Pixbuf(arr);

    }

  }

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
java-gnome-developer mailing list
java-gnome-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer

Reply via email to