In reply to Paul McMurray.

I don't fully understand your setup; for best advice, contact SAS Technical Support and describe your configuration. You don't mention SAS/IML Studio, so I assume you are calling R from PROC IML.

When you call R from PROC IML, you are calling R on the same machine that SAS is running on. You say "desktop SAS/R" so I assume you have SAS and R installed on a PC. In that case, SAS and R are both using (and competing for) the same RAM. Modern PCs often support up to 64GB of RAM, and each 16GB of RAM is really cheap (~$75), so check your available RAM and request more RAM if you have less than 32GB. In SAS, you can use the MEMSIZE option to control how much RAM is available for SAS procedures such as IML.

You also mention "Web based R Studio," which I assume is connected to a server somewhere that is running R. The most likely explanation for the difference you are seeing is that the R server is more powerful and has more RAM than the desktop PC.