9

This is related to my previous question freeing up memory in R

and was wondering if it was possible to reduce or clear the size of R's global string cache?...I have heard that it can only go up?

If it is possible, how do you do it?

Thx

Community
  • 1
  • 1
h.l.m
  • 13,015
  • 22
  • 82
  • 169

1 Answers1

1

I don't believe that is true. It looks like the garbage collector code marks unused CHARSXPs (the individual cached components of character vectors) and removes them.

hadley
  • 102,019
  • 32
  • 183
  • 245
  • could you please update the link using a tagged branch? Maybe I'm missing something but the linked line doesn't appear directly relevant, I suspect because of source code changes over the years. Perhaps it was here on current `trunk`? https://github.com/wch/r-source/blob/trunk/src/main/memory.c#L1785 – MichaelChirico Jun 09 '19 at 03:08
  • I would've linked to https://github.com/wch/r-source/blob/trunk/src/main/memory.c#L1794, but yeah. I don't remember what I was looking at 6 years ago though :( – hadley Jun 13 '19 at 20:07