我正在使用r的最新版本中的包"dismo“构建一个大型物种分布模型。当我使用以下代码处理基本模型时:
me <- maxent(x=train, p=p)我得到以下错误:
> Error in .jcall(mxe, "S", "fit", c("autorun", "-e", afn, "-o", dirout,
> : java.lang.OutOfMemoryError: unable to create new native thread在stackoverflow和互联网上有一些关于这个错误的讨论,但似乎没有人在r代码中解决这个问题。任何关于这个问题的意见都将不胜感激。
干杯,以色列
发布于 2013-07-11 08:08:23
如果您想给MaxEnt (运行它的dismo虚拟机)更多的内存,您可以通过在加载dismo库之前运行类似这样的命令(对于1 GB)来实现。
options(java.parameters = "-Xmx1g" )一些人报告了在Mac (Apple)计算机上使用此功能时出现的问题。具体来说,会出现以下错误消息:
Error in .jcall(mxe, "S", "fit", c("autorun", "-e", afn, "-o", dirout, : java.lang.InternalError: Can’t start the AWT because
Java was started on the first thread. Make sure StartOnFirstThread is not specified in your application’s Info.plist or on the command line.这是Mac上某些Java应用程序的已知问题。我们知道有两种解决方法:
1)在运行库rJava之前运行Sys.setenv(NOAWT=TRUE) (这是未加载rJava时dismo所做的)。2)使用JGR接口(基于Java的R GUI)。您可以从此处安装JGR:
https://stackoverflow.com/questions/15399796
复制相似问题