Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!

  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory Leak in JAI 1.1.1_01  RSS feed

sam cheung
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running the following small program which takes a URL (referring to an image), open the inputstream, encode in in BMP and put that in an byte array.
What I find out is the program starts with memory usage 1300K, but if the program continuously running for 6 hours (in a loop), the memory usage will become > 233,000K.
Since I did not specify any hotspot parameter, I expect the memory usage will stay at 64M (the default heap usage for jvm). But from my experiment, the memory usage keeps growing beyond 64M.
Is there a memory leak issue in JAI? I am using Window 2000, JDK 1.4.1_01 and JAI 1.1.1_01.
Thank you for your help.
// Here is the small program
static private void testURL2(URL url) {
ByteArrayOutputStream stream = null;
try {
InputStream is = url.openStream();
RenderedOp image1 = JAI.create("stream", SeekableStream.wrapInputStream(is, true));
stream = new ByteArrayOutputStream();
JAI.create("encode", image1, stream, "BMP", null);
} catch (Exception e) {
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!