]
Galder Zamarreño resolved HRJS-63.
----------------------------------
Resolution: Duplicate Issue
Will be indirectly fixed by HRJS-69
Investigate more recent or alternative Promise implementations
--------------------------------------------------------------
Key: HRJS-63
URL:
https://issues.jboss.org/browse/HRJS-63
Project: Infinispan Javascript client
Issue Type: Task
Reporter: Galder Zamarreño
Assignee: Galder Zamarreño
The current Promise implementation ({{promise:7.0.4}}) can have misleading GC behaviour.
If you create a promise out of a big number of promises, any linked function callbacks via
{{.then()}} will still see all the garbage generated by the Promises. Only when one of
those {{.then()}} functions returns a new Promise will all previous Promises and related
memory consumption be garbage collected.
Create a test that replicates this and verify whether newer implementations handle it
better, or whether alternative implementations avoid this issue.
An example of this can be found
[
here|https://gist.github.com/galderz/ba1bb305b8c592cbece3da566edfb12b]. In this [other
example|https://gist.github.com/galderz/38d3a0ed42729129167bbb7c2cfc3163] the problem is
avoided by generating a new promise after handling the big Promise.