zhztheplayer opened a new pull request, #11500:
URL: https://github.com/apache/incubator-gluten/pull/11500
The following code came across problematic:
```scala
private static final ReferenceMap<TaskMemoryManager, Factory> FACTORIES =
new ReferenceMap<>(
AbstractReferenceMap.ReferenceStrength.WEAK,
AbstractReferenceMap.ReferenceStrength.WEAK);
```
Because value is `WEAK`, the whole entry may be removed from map before the
Task is ended because the value might become weak-reachable before that.
It used to be `WEAK/STRONG` but was also leading to object leak because of
cycle references.
The PR refactors the code to completely remove the usage of `ReferenceMap`.
The factory lifecycle will be managed by `TaskResources` via Task completion
listener which is far more reliable than the weak reference approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]