Skip to content

Conversation

@ConeyLiu
Copy link
Contributor

@ConeyLiu ConeyLiu commented Sep 22, 2017

What changes were proposed in this pull request?

We only need request bbos.size - unrollMemoryUsedByThisBlock after unrolled the block.

How was this patch tested?

Existing UT.

reserveAdditionalMemoryIfNecessary()
serializationStream.flush()
if (bbos.size > unrollMemoryUsedByThisBlock) {
val amountToRequest = bbos.size - unrollMemoryUsedByThisBlock
Copy link
Contributor Author

@ConeyLiu ConeyLiu Sep 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we only need request the bbos.size - unrollMemoryUsedByThisBlock. I'm sorry for that. This mistake maybe introduced by my previous patch SPARK-21923.

@ConeyLiu
Copy link
Contributor Author

@cloud-fan Pls take a look. Thanks a lot.

@ConeyLiu ConeyLiu changed the title [SPARK-22097][CORE]Call serializationStream.close after we requested enough memory [SPARK-22097][CORE]Request an accurate memory after we unrolled the block Sep 22, 2017
@ConeyLiu
Copy link
Contributor Author

Hi @cloud-fan @jiangxb1987 Do you have time to check this? Thanks a lot.

@cloud-fan
Copy link
Contributor

ok to test

// Make sure that we have enough memory to store the block. By this point, it is possible that
// the block's actual memory usage has exceeded the unroll memory by a small amount, so we
// perform one final call to attempt to allocate additional memory if necessary.
if (keepUnrolling) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we merge this if into the next if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We maybe need request the extra-memory (bbos.size - unrollMemoryUsedByThisBlock). So the keepUnrolling maybe change in line 393.

@SparkQA
Copy link

SparkQA commented Oct 11, 2017

Test build #82616 has finished for PR 19316 at commit 3af730d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

serializationStream.close()
reserveAdditionalMemoryIfNecessary()
if (bbos.size > unrollMemoryUsedByThisBlock) {
val amountToRequest = bbos.size - unrollMemoryUsedByThisBlock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just fix that in reserveAdditionalMemoryIfNecessary ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we request val amountToRequest = (bbos.size * memoryGrowthFactor - unrollMemoryUsedByThisBlock).toLong in reserveAdditionalMemoryIfNecessary to avoid requesting for every records. But here we just need request the precise memory for the last request.

@cloud-fan
Copy link
Contributor

LGTM, merging to master!

@asfgit asfgit closed this in b5c1ef7 Oct 12, 2017
@ConeyLiu ConeyLiu deleted the putIteratorAsBytes branch October 13, 2017 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants