|
From: | William Krekeler |
Subject: | Octave Memory Exhausted Error |
Date: | Wed, 3 Nov 2010 15:12:33 +0000 |
I am in the process of testing Octave compatibility of a
code set developed in Matlab. The code successfully completes in Matlab 7.8.0.347
(R2009a). Despite having more than enough system memory I am getting the
following error in Octave: “error: memory exhausted or
requested size too large for range of Octave's index type -- trying to return
to prompt.” Any help determining the source of this error, or a work
around, is greatly appreciated. Relevant Machine Details: Windows XP Pro x64 12 GB physical ram Octave 3.2.4, pre-compiled install
version Script Details for Original Failure: I’ve
isolated the code failure to one line, but the error is not specific to this
line of code as simplifying the line of code also fails. The original line of
code and the simplified test line are as follows: <start code> ImageCube
= uint16( floor( (ImageCube - minIC).*(single(2^16-1)/(maxIC-minIC)) ) ); % [
above generates error] ImageCube
= ImageCube – minIC; % [above
generates error ] <end code> Variable
and Memory Information is as follows: ImageCube
= 648x480x648 single array using 806215680 bytes (~ 0.8 GB) minIC
= 1x1 single array using 4 bytes maxIC=
1x1 single array using 4 bytes At
failure Octave is using 828,728 kB (~0.8 GB) of memory, total memory used on
system = 3.25 GB, total memory free is roughly 8.6 GB for 12 GB total physical
memory. Testing: Following
the memory error above and a restart of Octave the following command succeeds.
The code below creates a variable whose size is ~1.4 GB using the 1024
definition, at 4 bytes per element of the 376999999
element array. Note 377999999 elements fails with the same error. The
test code implies two things, first, my original variable does not violate a
maximum number of supported elements in an array, second, that my original
variable does not violate a maximum memory allowed per variable. Though the
test could be saying that Octave is being limited to roughly 1.5 GB of memory,
which if the code duplicates an array during the math operations would mean
that my original 0.8GB ImageCube variable would become a 1.6GB memory
requirement during subtraction of the full array. Failure to perform
mathematical operations on the large array is confirmed by the failure of the
subtraction operation in the following codeset. <start code> Clear all;
ImageCube = ones(376999999, 1, ‘single’ ); % [ above
succeeds ] ImageCube
= ImageCube – 0; % [
above fails ] <end code> Any ideas for what could be causing this error or a work
around? Bill
Krekeler |
[Prev in Thread] | Current Thread | [Next in Thread] |