Openbravo Issue Tracking System - Modules
View Issue Details
0043313ModulesExternal Integration Infrastructurepublic2020-02-24 18:262020-03-02 12:07
caristu 
caristu 
highcriticalhave not tried
closedfixed 
5
 
 
AugustoMauch
No
0043313: Memory leak in SBOImporterStore and SBOExporterStore
The SBOImporterStore is an @ApplicationScoped bean that centralizes the generation of SBOImporters. To do so, it has an injection to point to retrieve the SBOImporter beans (which are @Dependant scoped) and retrieves the correct instance depending on an Entity Mapping in particular (this is because currently we support two kind of mapping types: ManualBOB and RetailAPI)

The problem is that all these created instances are living as long as the bean instance they are injected in is living. As the SBOImporterStore is @ApplicationScoped they are never being garbage collected which can eventually lead to OutOfMemory errors (see attached images with a memory dump of an environment affected by this issue).

This very same problem also happens with the SBOExporterStore.

See here[1] for a more detailed explanation regarding this problem.

[1] https://blog.akquinet.de/2017/01/04/dont-get-trapped-into-a-memory-leak-using-cdi-instance-injection/ [^]
In description
Avoid injecting the SBOImporter and SBOExportes in their corresponding application scoped stores.
No tags attached.
blocks defect 0043309 closed caristu Memory leak in SBOImporterStore and SBOExporterStore 
Issue History
2020-02-24 18:26caristuNew Issue
2020-02-24 18:26caristuAssigned To => caristu
2020-02-24 18:26caristuOBNetwork customer => No
2020-02-24 18:26caristuIssue generated from0043309
2020-02-24 18:27caristuRelationship addedblocks 0043309
2020-02-24 19:23caristuReview Assigned To => AugustoMauch
2020-02-24 19:23caristuNote Added: 0118065
2020-03-02 12:06caristuStatusnew => acknowledged
2020-03-02 12:06caristuStatusacknowledged => scheduled
2020-03-02 12:07caristuNote Added: 0118235
2020-03-02 12:07caristuStatusscheduled => resolved
2020-03-02 12:07caristuResolutionopen => fixed
2020-03-02 12:07caristuStatusresolved => closed

Notes
(0118065)
caristu   
2020-02-24 19:23   
Backport MR: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/merge_requests/1 [^]
(0118235)
caristu   
2020-03-02 12:07   
Backported to version 2.0.401: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/commit/e32748ce1ac4b9db72cf5e12745c9db850838798 [^]