BookmarkSubscribeRSS Feed
jbear
Calcite | Level 5

Hi,

I'm running into memory problems. How do I increase the memsize at SAS startup?

Thanks,

jbear

7 REPLIES 7
Doc_Duke
Rhodochrosite | Level 12

Check the SAS companion for your OS.  It is specified there.

SASKiwi
PROC Star

One way is on the SAS command: sas -memsize 2G will set the memory size to 2GB, or you could modify your SAS shortcut to do this.

Please bear in mind that changing the memsize option is not the only strategy for dealing with memory problems. If you want advice on other options, please provide more information on the cause of your memory problems.

Season
Lapis Lazuli | Level 10

What is the correct code to change the memory then? I tried the following code and the log reported an error:

-memsize 1T;
Season
Lapis Lazuli | Level 10

Thank you for your reply! In the past few hours, I searched for information regarding the MEMSIZE option on the web and found a convenient way to change the memory available for a SAS session into 1TB while launching a new SAS session on my computer that is using Windows 10.

Step 1: open a folder (any folder will do);

Step 2: Paste the following code in the address bar:

 

C:\Program Files\SASHome\SASFoundation\9.4\sas.exe -memsize 1T

For readers not familiar with the meaning of this code, it should be noted that the path is where my SAS is installed. Readers using my code should change that path to the where SAS is installed in their computer accordingly.

 

Step 3: Press the "Enter" button on the keyboard.

And everything is done. A SAS session is launched automatically after you press the "Enter" buttion. But it should be noted that the alteration done in this manner is only valid in this very session. In other words, if you end this session by closing SAS window and launch yet another one with another method (like clicking the SAS shortcut in the Start Menu), then the largest amount of memory SAS can use resumes to the default value, which is usually 2GB.

ballardw
Super User

@Season wrote:

Thank you for your reply! In the past few hours, I searched for information regarding the MEMSIZE option on the web and found a convenient way to change the memory available for a SAS session into 1TB while launching a new SAS session on my computer that is using Windows 10.

Step 1: open a folder (any folder will do);

Step 2: Paste the following code in the address bar:

 

C:\Program Files\SASHome\SASFoundation\9.4\sas.exe -memsize 1T

For readers not familiar with the meaning of this code, it should be noted that the path is where my SAS is installed. Readers using my code should change that path to the where SAS is installed in their computer accordingly.

 

Step 3: Press the "Enter" button on the keyboard.

And everything is done. A SAS session is launched automatically after you press the "Enter" buttion. But it should be noted that the alteration done in this manner is only valid in this very session. In other words, if you end this session by closing SAS window and launch yet another one with another method (like clicking the SAS shortcut in the Start Menu), then the largest amount of memory SAS can use resumes to the default value, which is usually 2GB.


This is basically the equivalent of modifying a desktop shortcut icon, just another way to provide start up command.

If you have a desktop icon then right click on it. In Windows go to the Target line.

My main short cut looks has a target line like:

"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg" -autoexec="d:\Users\Owner\Documents\autoexec.sas"

add a -memsize= option to that target.

You can have multiple start up short cut icons with different target lines, such as different configuration files (the -Config through sasvg.cfg), different -autoexec files, or anything that sets options.

Season
Lapis Lazuli | Level 10
Thank you for your reply and explanation!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1198 views
  • 2 likes
  • 6 in conversation