Skip to content

Commit

Permalink
fix volatile
Browse files Browse the repository at this point in the history
  • Loading branch information
lianhuiwang committed May 10, 2016
1 parent c3eeedf commit 42a8701
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private[spark] abstract class Spillable[C](taskMemoryManager: TaskMemoryManager)
@volatile private[this] var myMemoryThreshold = initialMemoryThreshold

// Number of elements read from input since last spill
@volatile private[this] var _elementsRead = 0L
private[this] var _elementsRead = 0L

// Number of bytes spilled in total
@volatile private[this] var _memoryBytesSpilled = 0L
Expand Down Expand Up @@ -111,7 +111,6 @@ private[spark] abstract class Spillable[C](taskMemoryManager: TaskMemoryManager)
if (!isSpilled) {
0L
} else {
_elementsRead = 0
val freeMemory = myMemoryThreshold - initialMemoryThreshold
_memoryBytesSpilled += freeMemory
releaseMemory()
Expand Down

0 comments on commit 42a8701

Please sign in to comment.