0

I have a Java program calling a R script using JRI. On calling re.eval("setMatValue('" + id + "'," + x + "," + y + "," + value + ")"); i get a java out of memory exception which is strange to me as neither the function in R is returning a value of any kind, nor am i mapping the (not existing) result to a java object. The matrices are only stored in the R context and referrenced by strings.

Is the Memory used by R included into the Java Heap? Or is JRI allocating space that actually isn't needed?

For the greater scope: I am trying to outsource the handling of the matrices used by my Code Analyzation implemented in Java to R. The matrices get very big, and therefore were taking up too much space in java, and I didn't find any matrix implementation in java able to create matrices of that size.

Abaddon666
  • 1,533
  • 15
  • 31
  • I also want to integrate Java with R using JRI. Is there any good tutorial which I can follow. – Arun Raja Jan 28 '15 at 07:26
  • If it is only java, if using netbeans IDE go to the home folder and find the conf file and chnage the memory values -Xms to higher value. – Arun Raja Jan 28 '15 at 07:28
  • For the first steps i found this very useful: http://www.studytrails.com/RJava-Eclipse-Plugin/. Unfortunately it is an R application (ran by Eclipse) which does not allow me to change the JVM Paramters. I set them globally for the JVM and the Memory is actually being used. But as stated in the question thats exactly what im using R for, namely to prevent Java from using too much memory – Abaddon666 Jan 28 '15 at 07:29
  • Can you please post the full code that is in your .Java file? (the one with class main) – Yehoshaphat Schellekens Feb 04 '15 at 11:51
  • Do you actually want the class containing the main method, or the class initializing and calling the REngine? – Abaddon666 Feb 04 '15 at 15:17

0 Answers0