Actions
Architecture #15678
closedRemove Map#mapValues because of memory not freed
Pull Request:
Effort required:
Name check:
To do
Fix check:
To do
Regression:
Description
Map#mapValues
is only a view on the original map. The original values are still referenced and the original map never freed.
For this one, the leak is really tricky, because in that code:
def main(args: Array[String]): Unit = { def res() = { printMem("in res 0") val m = Map(1 -> bigArray, 2 -> bigArray, 3 -> bigArray) val m2 = m.mapValues(_ => smallArray) printMem("in res 1") m2 } printMem("start") val map1 = res() printMem("end") }
m
is still referenced during all the life of m2
and so map1
. But from map1
point of view, it's a simple, small map.
Updated by François ARMAND over 5 years ago
- Tracker changed from Bug to Architecture
- Priority deleted (
0)
Updated by François ARMAND over 5 years ago
- Target version changed from 5.0.13 to 5.0.14
Updated by Vincent MEMBRÉ about 5 years ago
- Target version changed from 5.0.14 to 5.0.15
Updated by Vincent MEMBRÉ about 5 years ago
- Target version changed from 5.0.15 to 5.0.16
Updated by Nicolas CHARLES almost 5 years ago
What would be the prefered way ? map{ case (a,b) => b.doSomething} ?
Updated by Alexis Mousset almost 5 years ago
- Target version changed from 5.0.16 to 5.0.17
Updated by Vincent MEMBRÉ over 4 years ago
- Target version changed from 5.0.17 to 5.0.18
Updated by Vincent MEMBRÉ over 4 years ago
- Related to Bug #15675: Leak in Cache of Node Compliance and NodeInfo and perfs improvement added
Updated by Benoît PECCATTE over 4 years ago
- Target version changed from 5.0.18 to 6.2.0~beta1
Updated by Vincent MEMBRÉ about 4 years ago
- Target version changed from 6.2.0~beta1 to 6.2.0~rc1
Updated by François ARMAND about 4 years ago
- Status changed from New to Rejected
It's more complicated than that, and @ncharles already did a lot of work on that. Closing this one, a more details, case by case analysis need to be done.
Actions