Error cannot allocate vector size of 36gb

23 views
Skip to first unread message

Justin Biggerstaff

unread,
Mar 14, 2026, 3:05:26 PMMar 14
to ctmm R user group
Hi all,

I have been running a few rsf models on owl data and have been having an issue with a couple models where they will run for about a day, then spit out an error saying they can't allocate a vector of some certain size. To my knowledge, when ram becomes an issue in the rsf, the function should just try to finish with what it has, but this isn't happening for some reason. My system has 128gb of ram. Does anyone have recommendations on how I can lower the ram usage of my models? Would raising the error help? 


Thanks,

Justin

Christen Fleming

unread,
Apr 4, 2026, 12:30:03 AM (3 days ago) Apr 4
to ctmm R user group
Hi Justin,

max.mem="1 Gb" is the default argument, which you can decrease, though I don't know why you would run out of RAM with 128GB available. Are you using the default integrator="MonteCarlo" or "Riemann" ?

Best,
Chris

Justin Biggerstaff

unread,
Apr 4, 2026, 1:24:21 PM (2 days ago) Apr 4
to ctmm R user group

I used max.mem="120 Gb". I was initially using the MonteCarlo integrator but switched to the Riemann after struggling with this error. The Riemann integrator was having some other issues where I would get errors saying my raster grids weren't aligned even though they were the same resolution, extent, and cells were snapped together. I am still new to processing rasters in R so I'm not sure if there is some kind of silly mistake I am making on this end. 

Christen Fleming

unread,
Apr 5, 2026, 1:10:36 AM (yesterday) Apr 5
to ctmm R user group
Hi Justin,

With Monte-Carlo, I would just reduce max.mem. If you don't OOM immediately, it should iterate until it can't any more and then return what it has.
If you are using Riemann, then max.mem is not used - the memory usage shouldn't be that high for range-resident individuals.
Another thing that can help is to subset the rasters down to an area around the extent of the home-range before running rsf.fit/rsf.select.

Best,
Chris
Reply all
Reply to author
Forward
0 new messages