Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Linsolve out of memory error
Date: Sat, 4 Oct 2008 21:56:01 +0000 (UTC)
Organization: University College Dublin
Lines: 35
Message-ID: <gc8oph$hp6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223157361 18214 172.30.248.38 (4 Oct 2008 21:56:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 4 Oct 2008 21:56:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 87230
Xref: news.mathworks.com comp.soft-sys.matlab:493640


Can anyone explain the why I get  an 'out-of-memory' error using x=linsolve(A,b). Here are the details:

>> clear
>> memory
 Maximum possible array:               5810 MB (6.092e+009 bytes) *
 Memory available for all arrays:      5810 MB (6.092e+009 bytes) *
 Memory used by MATLAB:                 591 MB (6.195e+008 bytes)
 Physical Memory (RAM):                8189 MB (8.587e+009 bytes)
 
 *  Limited by System Memory (physical + swap file) available.
>> n=20000;A=rand(n,n);b=rand(n,1);x=zeros(n,1);
>> memory
 Maximum possible array:               2753 MB (2.886e+009 bytes) *
 Memory available for all arrays:      2753 MB (2.886e+009 bytes) *
 Memory used by MATLAB:                3644 MB (3.821e+009 bytes)
 Physical Memory (RAM):                8189 MB (8.587e+009 bytes)
 
 *  Limited by System Memory (physical + swap file) available.
>> whos
   Name          Size                    Bytes  Class     Attributes
 
   A         20000x20000            3200000000  double              
   b         20000x1                    160000  double              
   n             1x1                         8  double              
   x         20000x1                    160000  double              
 
>> x=linsolve(A,b);
 ??? Error using ==> linsolve
 Out of memory. Type HELP MEMORY for your options.


 MATLAB Version 7.6.0.324 (R2008a)  64 bit
 Operating System: Microsoft Windows Vista Ultimate 64 bit 
 Version 6.0 (Build 6001: Service Pack 1)
 Dell Precision 690 2xQuadcore Xeon 2.33MHz, 8GB RAM.