Question: Error: protect(): protection stack overflow
0
gravatar for Bioinfonext
13 days ago by
Bioinfonext250
Korea
Bioinfonext250 wrote:

Hi,

I am trying to do random forest analysis for microbiome data in R but I am getting below error , could you please suggest how I can resolve it?

> set.seed(123)
> #run random forest
> physeq.DNA.Close_5_Filtered_Classify <- randomForest(response~., data = rf.data, ntree = 200)
Error: protect(): protection stack overflow

Many thanks, bioinfonext

random forest R • 84 views
ADD COMMENTlink written 13 days ago by Bioinfonext250

Looks like this is a memory issue. Can you assign more memory to R (or Rstudio if that is what you are using)?

ADD REPLYlink written 13 days ago by genomax91k

I am working on iMac R terminal and try to use below codes but not resolved the issue.

Step 1: Open terminal,

Step 2:

cd ~
touch .Renviron
open .Renviron
Step 3: Save the following as the first line of .Renviron:

R_MAX_VSIZE=100Gb 
Note: This limit includes both physical and virtual memory; so setting _MAX_VSIZE=16Gb on a machine with 16Gb of physical memory may not prevent this error. You may have to play with this parameter, depending on the specs of your machine

Many thanks

ADD REPLYlink written 13 days ago by Bioinfonext250

I also tried this;

env R_MAX_VSIZE=700Gb R

but still getting same error!

ADD REPLYlink written 13 days ago by Bioinfonext250
  > gc()
         used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 267317 14.3     642811 34.4         NA   442668 23.7
Vcells 544293  4.2    8388608 64.0      32768  1770323 13.6
> sessionInfo()
R version 3.6.0 (2019-04-26)
ADD REPLYlink modified 13 days ago • written 13 days ago by Bioinfonext250

What is the size of the data file you are trying to use? While virtual memory can help in some instances it may not be able to avoid limitations of actual RAM you have available.

ADD REPLYlink written 13 days ago by genomax91k
file.info(Rf.data.txt")
              size isdir mode               mtime               ctime
Rf.data.txt 7951144 FALSE  644 2020-10-15 19:41:38 2020-10-15 19:41:38
                         atime uid gid  uname grname
ADD REPLYlink modified 13 days ago • written 13 days ago by Bioinfonext250
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2141 users visited in the last hour