要解决R中的“java.lang.OutOfMemoryError: Java heap space”问题,您需要更改全局选项,如下所示:
options(java.parameters = c("-XX:+UseConcMarkSweepGC", "-Xmx8192m"))
如果我在python中使用rpy2怎么办。我尝试了以下每个命令
from rpy2.robjects import *
from rpy2.robjects.packages import importr
rbase=importr('base')
from rpy2.robjects.functions import SignatureTranslatedFunction
rbase.options = SignatureTranslatedFunction(rbase.options,
init_prm_translate={'java_parameters': rbase.c("-XX:+UseConcMarkSweepGC", "-Xmx8192m")})
rbase.options(java_parameters = StrVector(rbase.c("-XX:+UseConcMarkSweepGC", "-Xmx8192m")))
rbase.options(java_parameters = rbase.c("-XX:+UseConcMarkSweepGC", "-Xmx8192m"))
但是它们没有效果。
任何建议将不胜感激。
烙印99
慕森王
相关分类