Increasing or Decreasing Memory Limit Available in R (Example Code)

In this tutorial you’ll learn how to increase or decrease the memory limit in R programming.

Example: Applying memory.limit() Function to Increase Memory Limit

runif(4444444444)                 # Applying runif function to large number
# Error: cannot allocate vector of size 33.1 GB
memory.limit()                    # Checking current memory limit 
# [1] 16267
memory.limit(size = 35000)        # Increasing memory limit
# [1] 35000
runif(4444444444)                 # Applying runif function again - works

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top