out of memory error on PC running SAS

Reply
Contributor
Posts: 21

out of memory error on PC running SAS

I have a DELL laptop computer with Windows 10 running a university edition of SAS that is downloaded onto the computer (I am not linked to a mainframe). I am using 64 bit SAS 9.4.TS 1M3. I may run it in Enterprise Guide 7.12 HF3 (7.100.2.3444) (64-bit).

 

I am getting an out of memory error.

I think that the problem is that the SAS code is constructing a very large array. The data set is not particularly large (7 columns by 53000 rows). I have not entirely given up on the idea that it is a programming error, but it is hundreds of lines of code. However, I can get it to run on a smaller data set.

 

How do I allocate more memory to SAS?

 

Thank you.

 

Tim

Super User
Posts: 3,111

Re: out of memory error on PC running SAS

Run your program with the SAS option fullstimer and the log will contain memory usage statistics for the step that failed. Compare that with the amount of memory your PC has.

 

You may also need to adjust the SAS memsize option if it is smaller than your PC physical memory. Run PROC OPTIONS to confirm this setting. 

Contributor
Posts: 21

Re: out of memory error on PC running SAS

I tried, but it didn't seem to recognize the command. When I look at the SAS documentation for this command it seems like it is only for SAS running on a server. I am running on a PC. I hit a button "run" and I don't see how to use the command.

 

Thank you for help.

 

Regards,

Tim

Super User
Posts: 17,868

Re: out of memory error on PC running SAS

SAS UE is limited to 2GB of RAM so theres not a lot for in memory calcs if your playing around with large arrays. 

Contributor
Posts: 21

Re: out of memory error on PC running SAS

The version that I am running is the SAS Education Analytic Suite. Is this the same as the University Edition? Does it have a memory limitation?

 

 

Thank you for your help.

 

Regards,

Tim

Super User
Posts: 5,257

Re: out of memory error on PC running SAS

If you think this is a programming issue, analyze the process on your smaller working sta set. You can't expect the forum to go through hundreds lines of code. Generally, hundreds lines of code is an indication that it can be done more simple and efficient.

UE is for learning purposes. If you have a program that works for a small subset you should be fine.
If you have a requirement other than this, you need to purchase a commercial SAS version.
Data never sleeps
Contributor
Posts: 21

Re: out of memory error on PC running SAS

I do not expect the forum to sift through hundreds of lines of code. It is possible that the program could be made more efficient, but this is irrelevant for today. All I know is that I cannot acomplish that task in the allotted time frame. I might (with help) be able to solve the out of memory issue.

 

I am running SAS Education Analytic Suite. SAS 9.4 TS1M3. Is this the University Edition that is only for small data sets?

 

Thank yoy for helping.

 

Regards,

Tim

 

Data never sleeps, but the dragons that guard it sometimes do. And the glowing red eyes in the dark, watch, and bide their time.

Super User
Posts: 17,868

Re: out of memory error on PC running SAS

Are you running SAS Studio - ie accessing it through a web browser or Base SAS?

 

If it's Base SAS you can play around with the MEMSIZE options and/or change the work library. 

A quick workaround to change the work library is to assing a USER library as that apparently overwrites the WORK library. I'm not sure that will work for where it stores temp stuff.  

 

You need to check your configuration file for the MEMSIZE option. 

Here's the link for EG, but the settings are the same for BASE:

 

http://support.sas.com/kb/40/480.html

 

 

Super User
Posts: 5,257

Re: out of memory error on PC running SAS

No, they step two different offerings.
I haven't found any information about limitations in your SAS edition.
So i guess the activities you could do is:
- evaluate your SAS memory settings, compared to you physical environment
- evaluate the excursion of your program with the option fullstimer active, on your subset data
- optimize your program where there are bottlenecks

Good luck
Data never sleeps
Contributor
Posts: 21

Re: out of memory error on PC running SAS

To all who tried to help. Thank you.

 

While none of the posts actually worked (as posted) they pointed me in a direction that solved the problem as much as possible. The end result was that 31 errors got reduced to 2 errors and I was able to show that the program used so much memory that it would never run with the computers that we have. This is likely a program that uses memory inefficiently, but that is an entirely different issue. The out of memory issue was solved to the extent possible, and that is all that I can hope for in this case.

 

With your posts I was able to ask SAS Technical support the right questions. I have posted the solution here, but it does require administrative privledges on the computer. In my case, my first attempt to change the files was denied. After IT showed me what to do, I could have done it all myself if I had known what to do in the first place.

 

Hi Timothy,

 

The MEMSIZE option cannot be set within a SAS program. You can set this option in your startup command or in your sasv9.cfg file.  See the instructions below to set the MEMSIZE value in your sasv9.cfg file.

 

 

First, make sure that you have a 64-bit version of SAS by running the following code in SAS:

%PUT Architecture: &SYSADDRBITS;

 

The log window should have the following output:

Architecture: 64

If you have 32-bit version of SAS, the memory limit is 2GB, and this cannot be increased unless you upgrade to 64-bit SAS.

 

To change the memory limit in SAS 9.4, follow these steps:

1. Navigate to C:\Program Files\SASHome\SASFoundation\9.4\nls\en and open the sasv9.cfg file in Notepad.  

2. Edit the "-MEMSIZE" value in your SASV9.cfg file.

 

For example,

 

-MEMSIZE 8G

 

This sets the memory limit of SAS to 8GB.  The MEMSIZE system option specifies the total amount of memory available to each SAS session. A value that is too low will result in out-of-memory conditions.  SAS does not automatically reserve or allocate the amount of memory that you specify in the MEMSIZE system option. SAS will use only as much memory as it needs to complete a process. For example, a DATA step might require only 20M of memory, so even though MEMSIZE is set to 500M, SAS will use only 20M of memory.

 

You can find more information on the memsize option here: http://support.sas.com/documentation/cdl/en/hostwin/67241/HTML/default/viewer.htm#n0srij4mcdpzv2n1vt....

 

Thanks,

 

Joe Chambers

SAS Technical Support

Windows Business Intelligence

Certified SAS 9 Platform Administrator

 

Ask a Question
Discussion stats
  • 9 replies
  • 995 views
  • 6 likes
  • 4 in conversation