forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 9:13 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: memory allocation limit in ALGLIB?
PostPosted: Sat Jun 05, 2010 4:41 pm 
Offline

Joined: Sat Jun 05, 2010 6:30 am
Posts: 5
Is there a limit to the memory allocation in ALGLIB? I tried the following code,
Code:
   ap::real_2d_array c,c1,c3;
   c.setlength(9000, 9000);
   c1.setlength(9000, 9000);
   c3.setlength(9000, 9000);

and my program crashes at c3.setlength

I think this limit is set by windows, at most 2gb?


Top
 Profile  
 
 Post subject: Re: memory allocation limit in ALGLIB?
PostPosted: Sun Jun 06, 2010 9:41 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
It depends on two factors. First one - OS limitations (2Gb under 32-bit OS, unlimited - under 64-bit OS).

Second factor - even under 64-bit OS ALGLIB supports only 32-bit array indexes. So maximum size of 1-dimensional array is 2^31-1 elements. However, no one objected to this limitation so far :) As for matrices, maximum size of matrix is (2^31-1)x(2^31-1) - which is enough for almost anyone. I think that the this limitation will be dropped in one of the next releases. I just want to make transition as smooth as possible, especially to avoid numerous "32 vs. 64 bit" issues.

As for your problem, you allocate 3*9000*9000*sizeof(double) bytes = 1.8 GB. Take into account that many linear algebra subroutines allocate temporary space, so no wonder that all virtual memory is consumed in this process.


Top
 Profile  
 
 Post subject: Re: memory allocation limit in ALGLIB?
PostPosted: Sun Jun 06, 2010 3:02 pm 
Offline

Joined: Sat Jun 05, 2010 6:30 am
Posts: 5
I am setting the 2d array to be used for calculating eigenvalues. So the 2d array is symmetrical, and the efficient way is to assign a 1d array to represent a symmetrical 2d array, which the matrix template library(mtl) is doing. But mtl is not as user friendly as ALGLIB, and so far I can't get mtl to work in visual studio 2008


Top
 Profile  
 
 Post subject: Re: memory allocation limit in ALGLIB?
PostPosted: Mon Jun 07, 2010 7:44 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Yes, I see that 2GB limit on 1D array length will be serious problem for such code. I think that this limitation will be dropped really soon, but as for packed storage for symmetric matrices - it may take as long as 6-12 months. In the near future I want to optimize non-packed linear algebra and FFT (both assembly optimizations and multi-core support). I understand now that packed storage is important for large symmetric problems, but assembly and multithreading are more important, I think. Just can't implement everything at once, so I have to sort thing by priorities :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 54 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group