提交 39e9e217 编写于 作者: F fyang

8171934: ObjectSizeCalculator.getEffectiveMemoryLayoutSpecification() does not...

8171934: ObjectSizeCalculator.getEffectiveMemoryLayoutSpecification() does not recognize OpenJDK's HotSpot VM
Reviewed-by: aph, andrew
Contributed-by: hedongbo@huawei.com
上级 929bb51c
...@@ -396,7 +396,8 @@ public final class ObjectSizeCalculator { ...@@ -396,7 +396,8 @@ public final class ObjectSizeCalculator {
*/ */
public static MemoryLayoutSpecification getEffectiveMemoryLayoutSpecification() { public static MemoryLayoutSpecification getEffectiveMemoryLayoutSpecification() {
final String vmName = System.getProperty("java.vm.name"); final String vmName = System.getProperty("java.vm.name");
if (vmName == null || !vmName.startsWith("Java HotSpot(TM) ")) { if (vmName == null
|| (!vmName.startsWith("OpenJDK ") && !vmName.startsWith("Java HotSpot(TM) "))) {
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"ObjectSizeCalculator only supported on HotSpot VM"); "ObjectSizeCalculator only supported on HotSpot VM");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册