Project

General

Profile

bug #6211

feature request #5974: Remove synonym relationships

massive heap consumption by service endpoint /portal/taxon/{uuid}/synonymy

Added by Andreas Kohlbecker almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib-remote
Target version:
Start date:
11/21/2016
Due date:
% Done:

100%

Severity:
critical
Found in Version:
Tags:

Description

some requests to /portal/taxon/{uuid}/synonymy are causing a massive heap consumption.

test case:


Related issues

Related to Edit - task #6208: implement synonymy service responding with DTO Rejected 11/21/2016

Associated revisions

Revision 58525579 (diff)
Added by Andreas Müller over 2 years ago

ref #6211 try to fix heap consumption in synonymy service

Revision 17b0c5e7 (diff)
Added by Andreas Müller over 2 years ago

fix #6211 reduce initialization for synonymy

Revision 11aa2415 (diff)
Added by Andreas Müller over 2 years ago

fix #6211 fix API incompatibility

Revision 0ede0320 (diff)
Added by Andreas Kohlbecker over 2 years ago

ref #6211 avoiding to deep initialization of synonym groups

Revision 484bf7ea (diff)
Added by Andreas Müller over 2 years ago

ref #6211 cleanup old code

History

#1 Updated by Andreas Kohlbecker over 2 years ago

  • Description updated (diff)

#2 Updated by Andreas Kohlbecker over 2 years ago

This seems to be caused by a cycle in the object graph which is either not detected or not handled correctly by json-lib.

#3 Updated by Andreas Müller over 2 years ago

The reason for this problem is, that the TaxonPortalController calls the ITaxonService.getSynonymsByHomotypicGroup() which calls Taxon.getSynonymsInGroup(HG, comp). This method initallizes each name in the homotypic groups and for each name it initializes each related TaxonBase. For names that are used in multiple taxa this creates a huge obejct graph or even a cyclic one that jsonlib can not handle correctly.
But even not cyclic graphs may become very large when serialized as many objects are serialized many times.

A solution is either to use a DTO (#6208) or to reload the required data in a separate session, once getSynonymsByHomotypicGroup is computed with a init-strategy that includes only those data really needed.

#4 Updated by Andreas Müller over 2 years ago

  • Related to task #6208: implement synonymy service responding with DTO added

#5 Updated by Andreas Müller over 2 years ago

Alternatively we may check if it is possible to adapt getSynonymsByHomotypicGroup() such that less data is initialized.

#6 Updated by Andreas Müller over 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#7 Updated by Andreas Müller over 2 years ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker

Both examples do now have < 1MB and load in reasonable time <= 5 sec. There still might be possibilities to improve this but I think we can close this ticket.

#8 Updated by Andreas Müller over 2 years ago

  • Description updated (diff)

#9 Updated by Andreas Kohlbecker over 2 years ago

  • Tags set to performance
  • Status changed from Resolved to Closed

I agree!

#10 Updated by Andreas Kohlbecker over 2 years ago

  • % Done changed from 50 to 100

#11 Updated by Andreas Müller over 2 years ago

  • Category changed from cdm to cdmlib-remote

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)