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: David Bateman
Subject: Re: What limits the largest size of matrix?
Date: Thu, 04 Oct 2007 21:04:18 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

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.



reply via email to

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