简体   繁体   中英

Discarding buffer because too big error while using Rserve

I am using Rserve to access R scripts from within my Java code. Everything is working perfect throughout the code where I pass variables to Rscripts and get the results back. However, almost at the end of the code, where I am accessing a R script, I get the following error:

WARNING: discarding buffer because too big (awaiting 44617265235 bytes)

and the execution halts with this error:

java.util.concurrent.ExecutionException: 

org.rosuda.REngine.Rserve.RserveException: eval failed, request status: invalid parameter
Caused by: org.rosuda.REngine.Rserve.RserveException: eval failed, request status: invalid parameter

I am not sure why and from where this error is generated and how to solve this? I found one solution on the web: https://github.com/cscheid/rserve-js/issues/7 but it did not prove very helpful. I also tried using connection.close() everytime after I access my R script but it did not work as well. Can someone help?

You might want to increase the maxinbuf. For example, in order to set it to 4GB, open (create a new if it doesn't exist) a file /etc/Rserv.conf (if you're on Linux or Mac) and put the following line:

maxinbuf 4194304

(the amount is in KB).

However, I see that the expected amount in your case is over 41GB, which is an unreasonable number (very unlikely that you actually pass a parameter of such size). Could you please share the code that actually causes this error (both Java and R code)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM