Skip to content

Commit

Permalink
fix: Deallocate row addresses and size arrays after exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Apr 7, 2024
1 parent a86626a commit 4317796
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ class RowPartition(initialSize: Int) {

def getNumRows: Int = rowAddresses.size

def getRowAddresses: Array[Long] = rowAddresses.toArray
def getRowSizes: Array[Int] = rowSizes.toArray
def getRowAddresses: Array[Long] = {
val array = rowAddresses.toArray
rowAddresses = null
array
}

def getRowSizes: Array[Int] = {
val array = rowSizes.toArray
rowSizes = null
array
}

def reset(): Unit = {
rowAddresses = new ArrayBuffer[Long](initialSize)
Expand Down

0 comments on commit 4317796

Please sign in to comment.