BookmarkSubscribeRSS Feed
Aman4SAS
Obsidian | Level 7

i facing error:

ERROR: Unable to allocate sufficient memory. At least 12600K bytes were requested. You must either increase the amount of memory

       available, or approach the problem differently.

ERROR: The SAS System stopped processing this step because of insufficient memory.

I tried to use option memsize=0 ; at the starting of my script. but it doesnt work.

kindly suggest me on the same.

thanks in advance.

11 REPLIES 11
ballardw
Super User

What did you set memsize to? Does your system actually have that much memory (plus enough for OS and other programs running)?

Aman4SAS
Obsidian | Level 7

I have tried  option memsize=0;  and no other program is running. And how can i know about my system memory as u suggested. I am not running batch script, i m running script in window mode

ouelletpatrick
Calcite | Level 5

Hi,

You can run a

proc options group=memory;run; and check current memsize setting. 

Memsize cannot be changed dynamically, if I remember correctly. If can be changes in the sas configuration options.

Also, please run again with

options fullstimer;

before the step that fails and this will report the amount of memory it uses.

Let us no.

Thanks.

Aman4SAS
Obsidian | Level 7

i tried to set -memsize=2G in config file.

and run proc option

got result:

MEMMAXSZ=2147483648

                   Maximum amount of memory allocated to support MEMLIB and MEMCACHE options.

LOADMEMSIZE=0     Suggested memory limit for loaded SAS executables

MEMSIZE=2147483648

                   Specifies the limit on the total amount of memory to be used by the SAS System

REALMEMSIZE=0     Limit on the total amount of real memory to be used by the SAS System

NOTE: PROCEDURE OPTIONS used (Total process time):

      real time           0.04 seconds

      cpu time            0.00 seconds

then run my script. still same error:


ERROR: Unable to allocate sufficient memory. At least 12600K bytes were requested. You must either increase the amount of memory        available, or approach the problem…

SASKiwi
PROC Star

In my experience 2G is a sufficient MEMSIZE setting for most SAS programs. With SAS 9.4 2G is in fact the SAS default setting. Also how much physical memory does your SAS computer have?

I suggest you also post the code giving the error so we can offer advice on that.

BillNeaton
Calcite | Level 5

I would increase the "MEMSIZE=2G" statement in your config file to some much larger number plus add the "OPTIONS FULLSTIMER;" statement.  After it runs successfully, check the SAS Log to see how much memory was actually used.  Then you can alter the MEMSIZE value to a number slightly higher than what is needed.  One thing to remember, is that SAS will allocate whatever memory is needed up to the MEMSIZE value.  If you have a MEMSIZE=50G in your config file and only need 10G, then SAS will only allocate 10G, not the 50G that is in the config.  You also should know how much memory is even available on your server....128G, 256G, etc.  What step are you even running?  PROC SORT?  DATA STEP HASH programming step?  PROC SQL with GROUP BY?  Are you JOINing multiple datasets?  How large are the input file(s)?  These are things you need to know to help determine how much memory you might need.

OS2Rules
Obsidian | Level 7

You also haven't mentioned what system you are running SAS on.  Some systems, like z/OS have much greater restrictions on memory

use and require specific steps to get more for your program.  From what I recall, the memsize=0 hole has been patched on most systems

so it won't just give you everything available.

Kurt_Bremser
Super User

12600K evaluates to appr. 12.5 MB, WAY below your 2GB. I suspect you run into a limit imposed by the operating system.

Post OS data, code and log.

Aman4SAS
Obsidian | Level 7

Hi all,

Thanks for all valuable input. I am working on it.

I am not able to post the data or code bcaz its very lengthy.

my script to run many reports excel[near about 500+] and after that 500+ charts for related area's in PDF.

script run fine but at last it show error reaching 440's area during creating charts.

i have changed memsize in config file as 0 , max, and 2G, but nothing work.

I am still working on that .

once again thanks for your valuable input.

jakarman
Barite | Level 11

You should know your machine environment well. Do not overspecify memory setting as you can run into thrashing.

http://en.wikipedia.org/wiki/Thrashing_(computer_science). At a server environment you have to deal with many users you could do something with serviceclasses (wlm). This is implemented with the latest Unix versions with Cgroups cgroups - Wikipedia, the free encyclopedia

This is a dedicated area to know what you are doing. Contact the related admins for that.

---->-- ja karman --<-----
kconnors
Obsidian | Level 7

If you are running on UNIX or LINUX, you may be able to run the ulimit command to find out how much memory is available to SAS; e.g. the following code would show in the SAS log the amount of memory available from the operating system (soft limit) for a process (but doesn't reflect how much SAS requested) and then show the amount of memory that could be allocated (hard limit) for a process.

filename foo pipe "ulimit -Sa" ;
data _null_ ;
infile foo ;
input ;
put _infile_ ;
run ;

filename foo pipe "ulimit -Ha" ;
data _null_ ;
infile foo ;
input ;
put _infile_ ;
run ;

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 8165 views
  • 0 likes
  • 9 in conversation