Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/5836#discussion_r29559816
--- Diff:
unsafe/src/main/java/org/apache/spark/unsafe/PlatformDependent.java ---
@@ -89,7 +89,9 @@ public static void putDouble(Object object, long offset,
double value) {
}
public static long allocateMemory(long size) {
- return _UNSAFE.allocateMemory(size);
+ long address = _UNSAFE.allocateMemory(size);
+ _UNSAFE.setMemory(address, size, (byte) 0);
--- End diff --
I don't think that we should zero out our allocated memory by default:
- In many cases, it is unnecessary and carries a performance penalty.
- `setMemory` isn't available in all versions of Java 6; this is one of the
reasons why I chose not to expose it in the `UNSAFE` facade.
---
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]