Re: Array question?
Posted by Wayne Rasband on
URL: http://imagej.273.s1.nabble.com/Array-question-tp3695862p3695863.html
> Dear ImageJ group,
> Is there a maximum limit for an array in imageJ macro?I want to save
> 24832000 many pixel values (i.e.my array length is 24832000 ) in an
> array.When I do that I get an error message saying
> "java.lang.OutOfMemoryError: Java heap space ".
You don't want to create a 24,832,000 element array in the ImageJ macro
language. Each element requires 36 bytes, so a 24,832,000 element array
would require 852MB! In a plugin, a 24,832,000 element byte array would
require only 24MB. Plus you would be able to access the elements at
least 100 times faster.
-wayne