-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-6405] Limiting the maximum Kryo buffer size to be 2GB. #5218
Conversation
Kryo buffers are backed by byte arrays, but primitive arrays can only be up to 2GB in size. It is misleading to allow users to set buffers past this size.
Test build #29260 has finished for PR 5218 at commit
|
Test build #29262 has finished for PR 5218 at commit
|
@@ -49,10 +49,20 @@ class KryoSerializer(conf: SparkConf) | |||
with Logging | |||
with Serializable { | |||
|
|||
private val bufferSize = | |||
(conf.getDouble("spark.kryoserializer.buffer.mb", 0.064) * 1024 * 1024).toInt | |||
private val bufferSizeMb: Double = conf.getDouble("spark.kryoserializer.buffer.mb", 0.064) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declaring the type here is more descriptive, but I'd leave it out to be consistent with the other variables in the class.
LGTM |
throw new IllegalArgumentException("spark.kryoserializer.buffer.max.mb must be less than " + | ||
s"2048 mb, got: + $maxBufferSizeMb mb.") | ||
} | ||
private val maxBufferSize = maxBufferSizeMb * 1026 * 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be 1026 * 1024?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch =D
LGTM pending jenkins |
Test build #29273 has finished for PR 5218 at commit
|
Test build #29277 has finished for PR 5218 at commit
|
LGTM - merged into master. |
Kryo buffers are backed by byte arrays, but primitive arrays can only be
up to 2GB in size. It is misleading to allow users to set buffers past
this size.