Daa-meganizer out of memory even with 1000GB memory allocated for 4GB daa file

Hello,
I am new to metagenomics analysis, and this is my first time using MEGAN. (I’m using MEGAN Community Edition (version 6.25.10, built 27 Jun 2024)).

I’ve assembled my reads to contigs and run diamond blastx on them. The diamond output for each sample is about 4GB.
I am now trying to run daa-meganizer on the diamond output.

This is the error message I get:

Version MEGAN Community Edition (version 6.25.10, built 27 Jun 2024)
Author(s) Daniel H. Huson
Copyright (C) 2024. This program comes with ABSOLUTELY NO WARRANTY.
Java version: 20.0.2; max memory: 9.8G
Functional classifications to use: EC, EGGNOG, GTDB, INTERPRO2GO, SEED
Loading ncbi.map: 2,396,736
Loading ncbi.tre: 2,396,740
Loading ec.map: 8,200
Loading ec.tre: 8,204
Loading eggnog.map: 30,875
Loading eggnog.tre: 30,986
Loading gtdb.map: 240,103
Loading gtdb.tre: 240,107
Loading interpro2go.map: 14,242
Loading interpro2go.tre: 28,907
Loading seed.map: 961
Loading seed.tre: 962
Meganizing: G1_R1_D11.fa.daa
Meganizing init
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at megan/megan.daa.DAAReferencesAnnotator.apply(DAAReferencesAnnotator.java:66)
at megan/megan.daa.Meganize.apply(Meganize.java:60)
at megan/megan.tools.DAAMeganizer.run(DAAMeganizer.java:251)
at megan/megan.tools.DAAMeganizer.main(DAAMeganizer.java:58)

My SLURM submit file is this:

#!/bin/bash

#SBATCH --job-name=megan
#SBATCH --ntasks=64
#SBATCH --nodes=1
#SBATCH --time=240:00:00
#SBATCH --mem=1000G
#SBATCH --error=megan_out_highmen/job.%J.err
#SBATCH --output=megan_out_highmen/job.%J.out
#SBATCH --mail-type=ALL
#SBATCH --partition=highmem2new
#SBATCH -a 0-59

date

ID=$(( SLURM_ARRAY_TASK_ID ))

files=( *.daa )

filename=“${files[$ID]}”
echo $filename

/home/user/megan/tools/daa-meganizer -i ${filename} -mdb /home/user/megan/megan-map-Feb2022.db

As you can see, I have allocated 1000GB memory, but it still runs out of memory. Am I doing something wrong? I would appreciate any help.
Thank you!

Hi @KHP,

How much RAM did you allocate when installing MEGAN? It does not depend on how much RAM you assign in the SLURM job. If you allocated 4 GB while installing MEGAN, then even if you assign 1000 GB in the SLURM job, MEGAN will still only use 4 GB.

You need to allocate the desired amount of RAM during installation. For example, if you want to use 100 GB, it must be set in the MEGAN configuration.

Go to the MEGAN installation directory and look for a file with the .vmoptions extension. Open it in a text editor and find a line like:

-Xmx14G

This means MEGAN can use up to 14 GB of RAM. To allow it to use 100 GB, change it to:

-Xmx100G


Best regards,
Anupam