Fit a cross-validated elastic net with cv.glmnet(x, y) on a design matrix that comfortably fits in memory, and the call can still fail. The reason is that the function needs several times the size of x while it runs, and nothing anywhere in your script says so. This post is about giving that requirement a home - a memory specification, written in R next to the code that knows it - first for a plain sequential call, then for the same call running in parallel.