-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Describe the bug
While developing a new Cryptogam report in Specify, RBGE has run into this issue:
I am trying to add a new field to a label template and I keep getting a java error (java.lang.OutOfMemoryError: Java heap space).
I have updated the query and the fields included in the report to include the new field, and I have copied various other fields in the template in the hope that one of the syntaxes will work – however I just keep hitting the error.
To Reproduce
Steps to reproduce the behavior:
- Use a copy of the
herb_rbgedatabase made after 2025-07-14 - Run the "Cryptogam Packet" report on the Collection Object with a catalog number of
00000662(/specify/view/collectionobject/662) - See the out of memory error
Below is the query and report file:
Label Template (Updated).json
Cryptogam Packet.jrxml.zip
After removing the following expression in the "Report Memory Investigation" label, the error does not happen with Collection Object 00000662:
($F{1,10,2,3.geography.country} == null ? "" : $F{1,10,2,3.geography.country} + "; ") +
($F{1,10,2,3.geography.subcountry} == null ? "" : $F{1,10,2,3.geography.subcountry} + "; ") +
($F{1,10,2,3.geography.subsubcountry} == null ? "" : $F{1,10,2,3.geography.subsubcountry} + "; ") +
($F{1,10,2,3.geography.subsubsubcountry} == null ? "" : $F{1,10,2,3.geography.subsubsubcountry} + "; ") +
($F{1,10.collectingevent.verbatimLocality} == null ? "" : "" + $F{1,10.collectingevent.verbatimLocality})When run again with a large set of records, the out of memory issue returns.
Expected behavior
It should not give an out of memory error when running the query.
Reported By
Robyn at Royal Botanic Gardens Edinburgh
Specify 7 System Information - 2025-08-08T13_48_49.853Z.txt
Additional context
mysql> select co.collectionobjectid, co.catalognumber, count(prep.collectionobjectid) as prep_count from collectionobject co left join preparation prep on prep.collectionobjectid=co.collectionobjectid group by co.collectionobjectid order by prep_count desc limit 10; +--------------------+---------------+------------+ | collectionobjectid | catalognumber | prep_count | +--------------------+---------------+------------+ | 174817 | 00174817 | 13 | | 704687 | 00704687 | 11 | | 214659 | 00214659 | 11 | | 531830 | 00531830 | 11 | | 1711966 | 01711966 | 11 | | 290466 | 00290466 | 10 | | 188083 | 00188083 | 9 | | 730260 | 00730260 | 9 | | 605800 | 00605800 | 9 | | 290080 | 00290080 | 9 | +--------------------+---------------+------------+ 10 rows in set (6.31 sec)
The second and fourth COs in particular causes a crash all by themselves:
704687(CatalogNumber:00704687)531830(CatalogNumber:00531830)