简体   繁体   English

运行 rjava 时如何处理“Java Heap Space”错误

[英]How to deal with “Java Heap Space” error while running rjava

I am using rJava package in R on MacOS.我在 MacOS 上的 R 中使用 rJava package。 This error happened:发生了这个错误:

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
java.lang.OutOfMemoryError: Java heap space

I need rJava to open an Excel file with xlsx package.我需要 rJava 来打开一个带有 xlsx package 的 Excel 文件。 With this error I can not read the.xlsx files.由于此错误,我无法读取 .xlsx 文件。 I wonder how to solve this problem?我想知道如何解决这个问题?

You need to modify the java parameters with the following function at the start of your script.您需要在脚本开始时使用以下 function 修改 java 参数。

options(java.parameters = "-Xmx8000m")

You may also need restart your environment first.您可能还需要先重新启动环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何处理“java.lang.OutOfMemoryError: Java heap space”错误? - How to deal with "java.lang.OutOfMemoryError: Java heap space" error? 在Android Studio中运行Android应用程序时出现Java堆空间错误 - Java Heap Space error while running Android app in Android Studio 运行mapreduce程序时出现“ Java堆空间不足内存错误” - “Java Heap space Out Of Memory Error” while running a mapreduce program 运行Junits时出现Java堆空间问题 - Java Heap Space Issue while running Junits 使用字符串缓冲区时如何解决Java堆空间错误? - How to resolve Java Heap Space error while using String Buffer? 写入文件时出现Java堆空间错误 - java heap space error while writing to a file java.lang.OutOfMemoryError: Java heap space Error while running hive table scan - java.lang.OutOfMemoryError: Java heap space Error while running hive table scan 运行简单的mapreduce作业时出现错误“ java.lang.OutOfMemoryError:Java堆空间” - Getting error “java.lang.OutOfMemoryError: Java heap space” while running simple mapreduce job 为大型数据集运行mapreduce代码时遇到Java堆空间错误 - Getting java heap space error while running a mapreduce code for large dataset Java堆空间错误 - Java heap space error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM