java.lang.NullPointerException- version 6.21.2, built 14 Mar 2021

Got the Following error:

Version   MEGAN Community Edition (version 6.21.2, built 14 Mar 2021)
Author(s) Daniel H. Huson
Copyright (C) 2020 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Java version: 14.0.1
Functional classifications to use: EC, EGGNOG, GTDB, INTERPRO2GO, SEED
Loading ncbi.map: 2,302,807
Loading ncbi.tre: 2,302,811
Loading ec.map:     8,081
Loading ec.tre:     8,085
Loading eggnog.map:    30,875
Loading eggnog.tre:    30,986
Loading gtdb.map:   240,103
Loading gtdb.tre:   240,107
Loading interpro2go.map:    13,894
Loading interpro2go.tre:    28,869
Loading seed.map:       979
Loading seed.tre:       980
Meganizing: /project/gbru_fy21_tomato_ralstonia/run/diamond_blastx_out/R102-H7-Death-8-C05-TCGAGTTG.daa
Meganizing init
Annotating DAA file using FAST mode (accession database and first accession per line)
Annotating references
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (166.5s)
Writing
10% 20% 30% 40% Caught:
java.lang.NullPointerException
        at java.base/java.lang.System.arraycopy(Native Method)
        at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:129)
        at megan/megan.daa.io.DAAModifier.appendBlocks(DAAModifier.java:140)
        at megan/megan.daa.io.DAAModifier.appendBlocks(DAAModifier.java:156)
        at megan/megan.daa.DAAReferencesAnnotator.apply(DAAReferencesAnnotator.java:250)
        at megan/megan.daa.Meganize.apply(Meganize.java:73)
        at megan/megan.tools.DAAMeganizer.run(DAAMeganizer.java:269)
        at megan/megan.tools.DAAMeganizer.main(DAAMeganizer.java:65)

real    3m15.875s
user    18m31.798s
sys     1m34.171s

Script ran:

time daa-meganizer -i /diamond_blastx_out/S1-FL-Death-6-B01-AGGAACGT.daa -alg weighted -lcp 25 -mdb /project/gbru_fy21_tomato_ralstonia/run/script/megandb/megan-map-Jan2021.db

I think I was running out t of memory.

So, what i did was: cd to .conda/envs/megan/opt/megan-6.21.2/MEGAN.vmoptions and allocated more memory – increased to 32G. This seems to solve the issues. Thought might be useful for others facing similar issues.

Thanks for the amazing tool.

1 Like

More memory is always better… thank you

I am having the exact same issues as the OP and have increased my available memory to 100G in the vmoptions file. Some files are meganized, others get the exact same set of error messages as above. Any suggestions would be greatly appreciated!

For anyone’s perusal…

Version MEGAN Community Edition (version 6.21.7, built 23 Jun 2021)
Author(s) Daniel H. Huson
Copyright (C) 2021 Daniel H. Huson. This program comes with ABSOLUTELY NO WARRANTY.
Java version: 14.0.1
Functional classifications to use: EC, EGGNOG, GTDB, INTERPRO2GO, SEED
Loading ncbi.map: 2,302,807
Loading ncbi.tre: 2,302,811
Loading ec.map: 8,081
Loading ec.tre: 8,085
Loading eggnog.map: 30,875
Loading eggnog.tre: 30,986
Loading gtdb.map: 240,103
Loading gtdb.tre: 240,107
Loading interpro2go.map: 13,894
Loading interpro2go.tre: 28,869
Loading seed.map: 979
Loading seed.tre: 980
Meganizing: /fs/scratch/PAS2304/Data/Salinity_ions/DIAMOND/m8_files/47_comb_trimmed.daa
Meganizing init
Annotating DAA file using FAST mode (accession database and first accession per line)
Annotating references
10% 20% 30% 40% 50% 60% 70% 80% 90% 100% (102.4s)
Writing
10% 20% 30% 40% 50% 60% 70% 80% 90% Caught:
java.lang.NullPointerException
at java.base/java.lang.System.arraycopy(Native Method)
at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:129)
at megan/megan.daa.io.DAAModifier.appendBlocks(DAAModifier.java:140)
at megan/megan.daa.io.DAAModifier.appendBlocks(DAAModifier.java:156)
at megan/megan.daa.DAAReferencesAnnotator.apply(DAAReferencesAnnotator.java:250)
at megan/megan.daa.Meganize.apply(Meganize.java:73)
at megan/megan.tools.DAAMeganizer.run(DAAMeganizer.java:269)
at megan/megan.tools.DAAMeganizer.main(DAAMeganizer.java:65)

I have looked at the indicated lines of code and believe this may be due to memory issues.
To help determine this, in the next release of MEGAN, at start up, the program will report the maximum amount of memory available to the program in the message window. At shutdown, the program will write the peak amount of memory used to the file error.log, which is located in the installation directory of the program. This should make it easier to figure out whether there is a memory issue.

Thank you–looking forward to it!
Best,
J