[rTassel] "Error Java heap space" if the package is already install in the Rsession

355 views
Skip to first unread message

Pauline Robert

unread,
Jul 28, 2022, 10:22:07 AM7/28/22
to TASSEL - Trait Analysis by Association, Evolution and Linkage
Hi everyone,

I'm facing a real issue with rTassel to compute distance matrix as the calculation require around 3GB of memory.

I followed the installation of rJAVA and rTASSEL, definied the options to increase java head size with options(java.parameters = c("-Xmx8000m")) before to load rTASSEL and defined the startLogger.

Sometimes I'm able to run the distanceMatrix function and sometimes not.

I noticed that it's working when i deleted rTASSEL in the win library , open a r session, defined options and then install rTASSEL again.
If rTASSEL is already installed and I open a new R session then it's not working and I'm facing the following errors

(New R session)
> setwd("C:/Users/probert/Bureau/Test")
> options(java.parameters = c("-Xmx8000m"))
> library(rTASSEL)
Welcome to rTASSEL (version 0.9.26)
 • Consider starting a TASSEL log file (see ?startLogger())

> rTASSEL::startLogger(fullPath = NULL, fileName ="test")
log4j:WARN No appenders could be found for logger (net.maizegenetics.util.LoggingUtils).
log4j:WARN Please initialize the log4j system properly.
TASSEL logging file created at: C:/Users/probert/Bureau/Test

> genoPathHMP <- "C:/Users/probert/Bureau/Test/genotype.hmp.txt"
> tasGenoHMP <- rTASSEL::readGenotypeTableFromPath(path = genoPathHMP)
> tasGenoHMP
A TasselGenotypePhenotype Dataset
  Class.............. TasselGenotypePhenotype
  Taxa............... 9011
  Positions.......... 6731
  Taxa x Positions... 60653041
---
  Genotype Table..... [x]
  Phenotype Table.... [ ]

> tasDist <- distanceMatrix(tasObj = tasGenoHMP)
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  :
  java.lang.OutOfMemoryError: Java heap space

I am using a PC with Intel i7- 16G RAM-  with Windows 10 Professionnel (x64)
R version 4.1.2 (2021-11-01) -- "Bird Hippie" /Platform: x86_64-w64-mingw32/x64 (64-bit) / RStudio 2022.07.1
Java version jdk-18.0.2 and jre1.8.0_341

Does anyone had also this problem, I really don't have any idea how to fix it ...

Thank you for your help !

Best,
Pauline


Brandon Monier

unread,
Aug 1, 2022, 4:42:47 PM8/1/22
to TASSEL - Trait Analysis by Association, Evolution and Linkage
Hi Pauline,

Just some clarification - when you mention "install", do you mean re-installing the entire package (e.g. devtools::install_github("maize-genetics/rtassel")) or just loading the library into an R session (e.g. library(rTASSEL))?

Pauline Robert

unread,
Aug 2, 2022, 2:54:10 AM8/2/22
to TASSEL - Trait Analysis by Association, Evolution and Linkage
Hi Brandon,

Each time I want to run my script, I need first to execute  "remove.packages("rTASSEL")" and then devtools::install_bitbucket(repo = "bucklerlab/rTASSEL",ref = "master",build_vignettes = FALSE,INSTALL_opts = c("--no-multiarch"))
Otherwise it is not working.

Pauline

Brandon Monier

unread,
Aug 3, 2022, 4:35:10 PM8/3/22
to TASSEL - Trait Analysis by Association, Evolution and Linkage
Hi Pauline,

We are actively investigating this. Out of curiosity, what memory stats do you see if you run this (pardon the rJava code):

options(java.parameters = c("-Xmx8000m"))
library(rTASSEL)
library(rJava)

rJC <- J("net/maizegenetics/util/Sizeof")
rJC$printMemoryUse()

Pauline Robert

unread,
Aug 4, 2022, 2:53:58 AM8/4/22
to tas...@googlegroups.com
Hi Brandon,

Thank you for your commitment,

In the first case when rTassel was already installed , R returned this :
> rJC <- J("net/maizegenetics/util/Sizeof")
> rJC$printMemoryUse()
-------------------------------
Current Heap Size: 1 MB
Max Available Heap: 8000 MB
-------------------------------

In the second case when rTassel was removed and re-installed , R returned nothing
> rJC <- J("net/maizegenetics/util/Sizeof")
> rJC$printMemoryUse()
>

Best,
Pauline

--
You received this message because you are subscribed to a topic in the Google Groups "TASSEL - Trait Analysis by Association, Evolution and Linkage" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tassel/E29l3N6e8Rk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tassel+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tassel/1e99a300-5f4c-4c0c-a084-6ffcddc79805n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages