help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What limits the largest size of matrix?


From: Peter Cloetens
Subject: Re: What limits the largest size of matrix?
Date: Fri, 05 Oct 2007 17:45:18 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)



David Bateman wrote:
Michael Creel wrote:
I'm using two different machines, both of which run  Ubuntu AMD64. Using
the command a = rand(b,b), I find that I can set b=17000 on a machine
that has 2GB of RAM. It goes into swap, but it works. That machine has
Octave 2.9.12 installed, and the CPU is AMD Turion dual core. On another
machine that has 8GB RAM and plenty of swap space, I get the message
"memory exhausted or requested size too large for range of Octave's
index type". That machine has 2.9.14 installed, and the CPUs are two
Xeons, a couple of years old. I believe that the compile options I used
for Octave were --enable-shared --disable-static on both machines. I
don't understand why the machine with more RAM is reluctant to create
the matrix.
Thanks, MIchael

Octave uses "int" for indexing, unless --enable-64  is used. You can
address 2GB of memory with the int type as only 31 bits are available.
Now a basic operation like a(i,j) in Array.h becomes data[i + nc*j] and
so its the product of the dimensions that count. Now the real type uses
8 bytes per value. and log2(17000.^2 * 8) = 31.106, and so therefore yes
it does exceed the addressable size of a matrix and 2.9.14 detects it
correctly. Probably the issue is in 2.9.12 rather than 2.9.14

D.

_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave

I tried this on a version compiled with --enable-64.
In this case I could successfully increase to
b=37660;a=rand(b,b);
Above the following error message appears:

error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt

This corresponds to 10.7 GB (the machine has physically 8 GB),
or log2(37660.^2 * 8) = 33.4

I'm not sure where this limitation comes from. Anyway not very relevant, probably nobody wants to work on matrices that size.

The very nice thing about the 64-bits compilation is that we can now handle correctly files that are larger than 2 GB. fseek and so on works :-)

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]