Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #593

Re: Memory Leak in swing

From "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Subject Re: Memory Leak in swing
Message-ID <1168259448.325939.112740@42g2000cwt.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <1168248935.342086.314340@s34g2000cwa.googlegroups.com>
Date 2011-04-27 15:28 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
cakmak wrote:
> When I profile my swing application I notice that after each tidy up my
> image container
...
>                     //load the image from the database, every stream
> are closed properly!
>                     Image image =
> DbInterfaceEtrainer.getInstance().getPersonImage(personNr);
>
>                     assert(image != null);
>                     ImageIcon icon = new ImageIcon(image);
...
> Any idea? thank you.

The JVM is notorious for caching images.  While this
is usually a help for inexperienced programmers, it is
a hindrance for anything else.

Doing an image slideshow, the only way I found to avoid
image caccing was to load it into a  byte[] array anf use
the constructor that accepts a byte array.

I do not know if that is practical for your DB.

Andrew T.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Memory Leak in swing appl "cakmak" <cakmak@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
  Re: Memory Leak in swing "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
    Re: Memory Leak in swing "cakmak" <cakmak@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
      Re: Memory Leak in swing "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
  Re: Memory Leak in swing "cakmak" <cakmak@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
    Re: Memory Leak in swing "cakmak" <cakmak@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
      Re: Memory Leak in swing "steve" <steve@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
        Re: Memory Leak in swing "cakmak" <cakmak@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
          Re: Memory Leak in swing "steve" <steve@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
      Re: Memory Leak in swing "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
      Re: Memory Leak in swing "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000

csiph-web