PDA

View Full Version : memory allocation issues



mirosh82
09-08-2006, 07:08 AM
Hello,

I keep getting the error message when I run my program saying "unable to allocate memory". I have tried using .SIZE, .LOCALS, and ..LOCALS to increase the code and data areas, but to no avail.

When I run an INFO command at the WAVE> prompt, it shows that I am using 0%. When I run the INFO command within one of my procedures, it shows that I am using 100% of everything. Any ideas what is going on here? I am a bit new to this and new to how the memory allocation works and how I can increase my memory space that I want my program to be able to use.

This is what I am seeing at the PV-WAVE error:

% Unable to allocate memory: to make array.
% Error occurred at WHEREIN <wherein.pro( 47)> (TENSOR_EQ).
% Called from COMPUTE_USAGE_BY_SHDESC <C:\VNI\wave\lib\mycode/sdvexe9.pro(1271)>.
% Called from PROCESS_FILES_AFTER_SELECT <C:\VNI\wave\lib\mycode/sdvexe9.pro(1694)>.
% Called from CB_SUBMITTIMEFRAME_AND_SAMPLING <C:\VNI\wave\lib\mycode/sdvexe9.pro( 589)>.
% Called from WTLOOP <wtloop.pro( 25)>.
% Called from WWLOOP <wwloop.pro( 28)>.
% Called from SDVEXE9 <C:\VNI\wave\lib\mycode/sdvexe9.pro( 688)>.
% Called from $MAIN$ .
% WTMAINLOOP: Error when executing callback.

When I put a ..LOCALS 40 40 into the procedure Compute_Usage_By_Shdesc, I have an info command response of:

% At COMPUTE_USAGE_BY_SHDESC <C:\VNI\wave\lib\mycode/sdvexe9.pro(1270)> .
% Called from PROCESS_FILES_AFTER_SELECT <C:\VNI\wave\lib\mycode/sdvexe9.pro(1694)>.
% Called from CB_SUBMITTIMEFRAME_AND_SAMPLING <C:\VNI\wave\lib\mycode/sdvexe9.pro( 589)>.
% Called from WTLOOP <wtloop.pro( 25)>.
% Called from WWLOOP <wwloop.pro( 28)>.
% Called from SDVEXE9 <C:\VNI\wave\lib\mycode/sdvexe9.pro( 688)>.
% Called from $MAIN$ .
Code area used: 100.00% (1024/1024), Data area used: 26.61% (464/1744)
# local variables (including 2 parameters): 11/51
# common symbols: 18/58


But I still get the above error saying that we are unable to allocate memory to make the array.

I am stuck here...any ideas...what am I doing wrong?

Thanks,
Mike

totallyunimodular
09-08-2006, 10:18 AM
Hi mirosh82,

The problem seems to be coming from the routine WHEREIN:

% Unable to allocate memory: to make array.
% Error occurred at WHEREIN <wherein.pro( 47)> (TENSOR_EQ).
...

WHEREIN can be memory-intensive because of the call to TENSOR_EQ. Thus, for example, if you are comparing two arrays of one million elements each, the WHEREIN would need to create a temporary array of size (1e6)^2. In PV-WAVE 8.51, WHEREIN's performance was improved. What version of PV-WAVE are you using, and what data are you operating on?

mirosh82
09-08-2006, 11:05 AM
Yes, I started to notice the culprit being WHEREIN and tensor_eq in general. We are using Version 8.51 of PV-WAVE, but I am still having this problem. I am working with large string arrays.

My code for this wherein statement is:


idx = WHEREIN(node, nodes_to_process, count)

where the node array has upwards of 163,525 string elements and nodes_to_process has upwards of 4,299 string elements.

I am using PV-WAVE 8.51, so according to your last statement, I shouldn't be experiencing this problem, but I still am! What could be the problem?

Thanks,
Mike

mirosh82
09-11-2006, 07:16 AM
Does anyone have any suggestions? I still have not been able to figure this out.

Thanks,
Mike

donb
09-13-2006, 03:37 PM
Hi Mike,

The memory allocation improvements in WHEREIN were included as part of the PV-WAVE 8.51 b release. To verify exactly which patch version you might have installed issue the following command at the PV-WAVE prompt:

WAVE> print, !version
{ 80x86 Windows-NT 8.51 b i386nt }
WAVE>

If you do not see the "b" after 8.51, you can get the latest release from http://www.vni.com/products/wave/pvwave/download.html.

mirosh82
09-13-2006, 05:26 PM
Thanks Don, I did indeed have version 8.51, not the b revision. I am upgrading and testing tomorrow.

Thanks again...I will keep you posted.

-Mike

mirosh82
09-14-2006, 07:16 AM
It works!

Thanks for the information Don...I really appreciate it.

-Mike

PS - I still need to plan some more training, I will be getting back to you or Manny about this shortly.