X-Sender: glguerin@pop.amug.org Mime-Version: 1.0 To: java-dev@lists.apple.com From: Greg Guerin Subject: Re: Exception loading large images Sender: java-dev-admin@lists.apple.com X-BeenThere: java-dev@lists.apple.com X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: This list is for the discussion of Java development List-Unsubscribe: , List-Archive: Date: Wed, 5 Dec 2001 13:37:35 -0700 Joshua E Smith wrote: >I'm getting this exception on stderr occasionally when loading very >large (2048x2048) JPG images (OS 10.1.1): > [...] >Oddly, the images seem to be just fine. The input stream is a >ByteArrayInputStream (that is, the entire encoded JPG is sitting in >memory as a blob of byte data). Could the program be exhausting memory, or running low? A 2Kx2K decoded 32-bit image is 16 MB, which is not something you'd want to have many of unless you dramatically expanded your default heap-limit of 64MB. I mention this because the documentation for MRJAppBuilder on X is flat wrong when it tells you which property sets the heap-limit. The real way to set the heap-limit is with: com.apple.mrj.application.vm.options=-Xmx128M or whatever you want to set the max heap-limit to. This is never actually described or elucidated anywhere, but is obliquely hinted at in the release notes: And to further confuse things, MRJAppBuilder on X foolishly uses the futile: com.apple.mrj.application.gc.max=nnM Someone at Apple should at least fix the darn release notes to explain this more clearly. It wouldn't hurt if that explanation said, "The com.apple.mrj.application.gc.max property has never worked on Mac OS X Java, not even in 10.0. Only the com.apple.mrj.application.vm.options property works, across any version of Java on 10.0 through 10.1.1." FWIW, the non-use of gc.max is easily illustrated with a simple program (source available on request). It is equally easy to demonstrate that vm.options DOES work, from 10.0 on up. -- GG _______________________________________________ java-dev mailing list java-dev@lists.apple.com http://www.lists.apple.com/mailman/listinfo/java-dev