Cannot allocate vector of size

I'm getting the error "cannot allocate vector of size 111.3" (see uploaded photo).

The object referenced in my code, df, seems relatively small, 22.4 million rows and 38 columns, which comes out to 148.6 Mb when saved as an .RDS file.

I realize that there are similar topics in the Posit Community, but none has provided a solution so far:

Some of the suggestions include using the memory.limit() function, but this is (apparently) no longer supported by R. I get this warning when I try to use on my desktop: "'memory.limit()' is no longer supported", and this warning on the Posit server: "'memory.limit()' is Windows-specific".

I've also tried system('free -m'), but the output on the Posit server is just this: [1] 127.

I'm at my wit's end. Any suggestions?

Lets do some estimates. A double / numeric would be 8bytes. You have 22.4million of those uncompressed for a single column, so that would be 172Mb for a column, lets say you have 35. That would be 6gb uncompressed.
So perhaps you have highly compressible data, but in uncompressed representation it seems you do have large memory needs.
How much system memory do you have ?
Can you do with loading and processing the data in parts rather than as a whole?

1 Like