如何修复R:error in.jcall中的此错误(“RJavaTools”、“Ljava/lang/Object”、“invokeMethod”、“cl”、“java.lang.OutOfMemoryError:java堆空间”

如何修复R:error in.jcall中的此错误(“RJavaTools”、“Ljava/lang/Object”、“invokeMethod”、“cl”、“java.lang.OutOfMemoryError:java堆空间”,r,R,我正在使用Climate4R()中加载程序包中的函数loadGridData。 我已使用以下方法汇总了最高温度(tasmax)的5个每日Cmip6文件(netcdf): 然后,当我尝试加载数据时: #first create the dictionary to change Kelvin to Celcius dictionary <- tempfile(pattern = "dicCDX", fileext = ".dic") writeLines

我正在使用Climate4R()中加载程序包中的函数
loadGridData
。 我已使用以下方法汇总了最高温度(tasmax)的5个每日Cmip6文件(netcdf):

然后,当我尝试加载数据时:

#first create the dictionary to change Kelvin to Celcius
dictionary <- tempfile(pattern = "dicCDX", fileext = ".dic")
writeLines(c("identifier,short_name,time_step,lower_time_bound,upper_time_bound,cell_method,offset,scale,deaccum,derived,interface","tasmax,tasmax,24h,0,24,max,-273.15,1,0,0,"), dictionary)

#Load the data
test<-loadGridData("test.ncml","tasmax",dictionary = dictionary)   
我在stackoverflow上的其他文章中也看到过这个错误,但它们都是指excel文件的问题。这里聚合的原始文件是.nc文件,我试图从中加载数据的文件是.ncml文件

有没有办法在不耗尽内存的情况下加载数据?这只是硬件问题吗

#first create the dictionary to change Kelvin to Celcius
dictionary <- tempfile(pattern = "dicCDX", fileext = ".dic")
writeLines(c("identifier,short_name,time_step,lower_time_bound,upper_time_bound,cell_method,offset,scale,deaccum,derived,interface","tasmax,tasmax,24h,0,24,max,-273.15,1,0,0,"), dictionary)

#Load the data
test<-loadGridData("test.ncml","tasmax",dictionary = dictionary)   
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  java.lang.OutOfMemoryError: Java heap space