-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.0_01, 1.1.2
-
generic, x86
-
generic, windows_xp
Running the attached test as either
$ java JPEGTest imageio
or
$ java JPEGTest imageio rgb
produces the same result:
27000832
20406272
47407104
which indicates that the JPEG writer is consuming an additional 20 Mb when writing a 27Mb image. Similar behavior is observed when using the old core J2SE JPEG API to write BGR images but this old API consumes no additional memory when writing RGB images.
###@###.### 2005-05-10 18:05:46 GMT
###@###.### 2005-05-10 18:06:37 GMT
The original test case must have been changed from 3000x3000 before attaching to the report. I think the VM used was version 1.4.2. I changed the size to 3000x3000 and ran the test again; a transcript follows.
--- BEGIN ---
$ java -mx512m JPEGTest imageio rgb
Using RGB source image
Testing Image I/O
27000832
20389888
47390720
bpb@chatnoir:tmp{562}$ ~/test/solaris-sparc/jdk1.5.0_01/bin/java -mx512m JPEGTes
t imageio rgb
Using RGB source image
Testing Image I/O
29360128
0
29360128
bpb@chatnoir:tmp{563}$ java -mx512m JPEGTest imageio bgr
Using BGR source image
Testing Image I/O
27000832
20389888
47390720
bpb@chatnoir:tmp{564}$ ~/test/solaris-sparc/jdk1.5.0_01/bin/java -mx512m JPEGTes
t imageio bgr
Using BGR source image
Testing Image I/O
29360128
16777216
46137344
bpb@chatnoir:tmp{565}$ java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
bpb@chatnoir:tmp{566}$ ~/test/solaris-sparc/jdk1.5.0_01/bin/java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode)
--- END ---
So it looks as if the problem is fixed for RGB in 1.5.0_01 versus 1.4.2_04 but a problem remains for BGR.
$ java JPEGTest imageio
or
$ java JPEGTest imageio rgb
produces the same result:
27000832
20406272
47407104
which indicates that the JPEG writer is consuming an additional 20 Mb when writing a 27Mb image. Similar behavior is observed when using the old core J2SE JPEG API to write BGR images but this old API consumes no additional memory when writing RGB images.
###@###.### 2005-05-10 18:05:46 GMT
###@###.### 2005-05-10 18:06:37 GMT
The original test case must have been changed from 3000x3000 before attaching to the report. I think the VM used was version 1.4.2. I changed the size to 3000x3000 and ran the test again; a transcript follows.
--- BEGIN ---
$ java -mx512m JPEGTest imageio rgb
Using RGB source image
Testing Image I/O
27000832
20389888
47390720
bpb@chatnoir:tmp{562}$ ~/test/solaris-sparc/jdk1.5.0_01/bin/java -mx512m JPEGTes
t imageio rgb
Using RGB source image
Testing Image I/O
29360128
0
29360128
bpb@chatnoir:tmp{563}$ java -mx512m JPEGTest imageio bgr
Using BGR source image
Testing Image I/O
27000832
20389888
47390720
bpb@chatnoir:tmp{564}$ ~/test/solaris-sparc/jdk1.5.0_01/bin/java -mx512m JPEGTes
t imageio bgr
Using BGR source image
Testing Image I/O
29360128
16777216
46137344
bpb@chatnoir:tmp{565}$ java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
bpb@chatnoir:tmp{566}$ ~/test/solaris-sparc/jdk1.5.0_01/bin/java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode)
--- END ---
So it looks as if the problem is fixed for RGB in 1.5.0_01 versus 1.4.2_04 but a problem remains for BGR.
- relates to
-
JDK-6266748 JPEGImageWriter.write() makes a copy of the raster (inefficient)
- Resolved
-
JDK-5086246 The JPEG encoder reserves a lot of memory to convert large BGR images
- Open