What does (Mb) Ncells 284.8 Vcells 459.9 mean in RStudio

16 Views Asked by At

I used the function gc() when the RAM looks like it is going RED and the message that I received is Mb Ncells 284.8 and Vcells 459.9.

What does that mean, especially after I just saved 8GB of memory to RStudio with their $25.00 a month subscription plan.

1

There are 1 best solutions below

0
Sophie On

R, following lisp language heritage, is based on S expressions. S expressions are a tree-like structure that can be represented with "lists". list(1, 2, 3) is a list of three numbers. List can also contain lists as in list(1, list(3, 4), 5), forming a tree of lists. At lower level, lists can be seen as a cons. A cons is a pair (data, other cons), list(1, othercons). Ncells are those cons. In R, cons are called Node cells (Ncells) (they are in fact slightly more complicated than that but it does not matter for the sake of basic explanation). gc() Ncells returns the number of Ncells used and the space occupied by them, expressed in Mb. max used gives the maximum usage reached during your current session.

Vcells are a special type of cells to hold more efficiently list of the same element type (aka vectors). Vcells reports the number of those cells and the space in Mb occupied by them.

gc trigger reports the thresholds when the next garbage collection will be run.

the message that I received is Mb Ncells 284.8 and Vcells 459.9.

It means that you use 284.8 Mega bytes and 459.9 Mega bytes.

8GB of memory

8GB = 8000 MB, that is a lot more than what you are using.