View Full Version : Unable to allocate memory

11-20-2008, 02:04 PM
In my constant pursuit of seeing just how far I can bend PV-WAVE without breaking it I'm running out of memory. I'm using WHEREINVEC to find 2,795 three-vectors in an array of 28,412 3-vectors. WHEREINVEC returns "% Unable to allocate memory: to make array.
Not enough core" Still working in VAX-land by the way...

I've tried implementing ..LOCALS 100,100 and that doesn't seem to work either. I've never fully understood ..LOCALS implementation. Please don't tell me I should use a FOR loop. ;)


11-20-2008, 08:28 PM
Hi SpinMan,

I'll let others handle the out of memory question and the use of WHEREINVEC.

For ..LOCALS, the concept here is when PV-WAVE compiles a routine it can figure out how many variables will be needed at execution time. ..LOCALS is a way to tell the compiler that you're going to be creating local variables during execution, so PV-WAVE allocates that amount of extra space. The way to create new variables within a routine is with the EXECUTE command.

You can check the PV-WAVE docs for 'executive commands'; there are good desciptions of what .SIZE, .LOCAL and ..LOCALS do. However, this set of executive commands are not really related to your 'out of memory' conditions.

VAX shouldn't matter, unless your user quotas are rather restrictive. And the introduction of FOR loops is generally not the best solution; elimination of loops is a much better idea!

Cheers, Don B.

11-21-2008, 06:39 PM
hi spinman;
the "unable to allocate memory" error means just what
you might expect: no more system memory is available
for the pv-wave process; to avoid a loop, whereinvec.pro
does a tensor_eq on the two input matrices; for your
input array sizes, this would produce 715mb array; this is
not that big, so it could be that you have used a lot of
memory elsewhere in your code, or that your machine
does not have very much memory, or that your vms page
file quota is set too low; if you cannot change any of these
factors, then the only easy workaround is to call whereinvec
in a loop over a few indices; for example, a small loop
from 0 to 1 could be used to break the large array into two
pieces, each of which could be processed individually;

11-26-2008, 12:33 PM
Additional information which may or may not be helpful:

Link to tips result (http://www.vni.com/cgi-bin/tipsengine.pl?id=946&formType=GET&kw=unable+allocate)