Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/11874#discussion_r57257678
--- Diff:
core/src/main/scala/org/apache/spark/memory/StorageMemoryPool.scala ---
@@ -110,17 +140,21 @@ private[memory] class StorageMemoryPool(lock: Object)
extends MemoryPool(lock) w
* Try to shrink the size of this storage memory pool by `spaceToFree`
bytes. Return the number
* of bytes removed from the pool's capacity.
*/
- def shrinkPoolToFreeSpace(spaceToFree: Long): Long = lock.synchronized {
- // First, shrink the pool by reclaiming free memory:
- val spaceFreedByReleasingUnusedMemory = math.min(spaceToFree,
memoryFree)
- decrementPoolSize(spaceFreedByReleasingUnusedMemory)
- val remainingSpaceToFree = spaceToFree -
spaceFreedByReleasingUnusedMemory
+ def shrinkPoolToFreeSpace(spaceToFree: Long): Long = {
+ var spaceFreedByReleasingUnusedMemory = 0L
--- End diff --
if you do the `val (x, y) = lock.synchronized { ... }` thing here then you
don't need a var
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]