File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
core/src/main/scala/spark Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -83,16 +83,12 @@ object SizeEstimator extends Logging {
83
83
hotSpotMBeanName, classOf [HotSpotDiagnosticMXBean ]);
84
84
return bean.getVMOption(" UseCompressedOops" ).getValue.toBoolean
85
85
} catch {
86
- case e : IllegalArgumentException => {
87
- logWarning(" Exception while trying to check if compressed oops is enabled" , e)
88
- // Fall back to checking if maxMemory < 32GB
89
- return Runtime .getRuntime.maxMemory < (32L * 1024 * 1024 * 1024 )
90
- }
91
-
92
- case e : SecurityException => {
93
- logWarning(" No permission to create MBeanServer" , e)
94
- // Fall back to checking if maxMemory < 32GB
95
- return Runtime .getRuntime.maxMemory < (32L * 1024 * 1024 * 1024 )
86
+ case e : Exception => {
87
+ // Guess whether they've enabled UseCompressedOops based on whether maxMemory < 32 GB
88
+ val guess = Runtime .getRuntime.maxMemory < (32L * 1024 * 1024 * 1024 )
89
+ val guessInWords = if (guess) " yes" else " not"
90
+ logWarning(" Failed to check whether UseCompressedOops is set; assuming " + guessInWords)
91
+ return guess
96
92
}
97
93
}
98
94
}
You can’t perform that action at this time.
0 commit comments