RDGuida
RDGuida

Reputation: 566

error: arma::memory::acquire(): out of memory for Armadillo

I encounter the error described in the title when I try to multiply a 10516x66 matrix by a 66x10516 (a matrix by its transposed). The result should be a 10516x10516 matrix which of course I never achieve. Maybe my reasoning is flawed but since my matrix is is a Mat<double> and each double is 8 bytes the result should be 10516*10516*8 = 884690048 bytes = 0.88469 Gbytes. My machine is a Windows with 8 Gb of RAM, I am running a 32-bit minGW compiler. Any idea whiy this is happening and how I can overcome the issue?

Upvotes: 2

Views: 2470

Answers (1)

Severin Pappadeux
Severin Pappadeux

Reputation: 20080

32bit programs running under 64bit hosts on Windows could use up to 4Gb of memory. To do so, you have to use special option /LARGEADDRESSAWARE during linking.

Link: https://msdn.microsoft.com/en-us/library/wz223b1z(VS.80).aspx

Most likely, your process is limited to 2Gb and at the moment of allocation there is either not enough memory or not enough continuous memory. Moving to 4Gb might quickly solve the problem

UPDATE

Looks like equivalent mingw32 linker option is --large-address-aware

Upvotes: 1

Related Questions