Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Andrew Thompson" Subject: Re: Memory Leak in swing Message-ID: <1168259448.325939.112740@42g2000cwt.googlegroups.com> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <1168248935.342086.314340@s34g2000cwa.googlegroups.com> References: <1168248935.342086.314340@s34g2000cwa.googlegroups.com> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 31 Date: Wed, 27 Apr 2011 15:28:25 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918105 96.60.20.240 (Wed, 27 Apr 2011 10:28:25 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:28:25 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:593 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