Book Image

R High Performance Programming

Book Image

R High Performance Programming

Overview of this book

Table of Contents (17 chapters)
R High Performance Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 6. Simple Tweaks to Use Less RAM

So far, we have learned the techniques to overcome CPU limitations and improve the speed of R programs. As you can recall from Chapter 1, Understanding R's Performance – Why Are R Programs Sometimes Slow? that another key constraint of R is memory. All the data that an R program needs to perform its tasks on must be loaded into the computer's memory or RAM. RAM is also needed for any intermediate computations, so the amount of RAM needed to process a given dataset can be many times the size of the dataset, depending on the type of tasks or algorithms being executed. This can become a problem when a large dataset needs to be processed, or when there is little RAM available to complete the tasks.

In this chapter and the next, we will learn how to optimize the RAM utilization of R programs so that memory-intensive tasks can be executed successfully.

This chapter covers:

  • Reusing objects without taking up more memory

  • Removing intermediate data when it is no...