Merge pull request #9464 from alimate/BAEL-4146
BAEL-4146: How Much Space boolean and boolean[] consumes?
This commit is contained in:
commit
1d5b0c7759
|
@ -65,7 +65,12 @@
|
|||
<groupId>org.apache.bcel</groupId>
|
||||
<artifactId>bcel</artifactId>
|
||||
<version>${bcel.version}</version>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.jol</groupId>
|
||||
<artifactId>jol-core</artifactId>
|
||||
<version>${jol-core.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
@ -74,6 +79,7 @@
|
|||
<javaassist.version>3.27.0-GA</javaassist.version>
|
||||
<esapi.version>2.1.0.1</esapi.version>
|
||||
<sun.tools.version>1.8.0</sun.tools.version>
|
||||
<jol-core.version>0.10</jol-core.version>
|
||||
<asm.version>8.0.1</asm.version>
|
||||
<bcel.version>6.5.0</bcel.version>
|
||||
</properties>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.baeldung.boolsize;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openjdk.jol.info.ClassLayout;
|
||||
import org.openjdk.jol.vm.VM;
|
||||
|
||||
public class BooleanSizeUnitTest {
|
||||
|
||||
@Test
|
||||
public void printingTheVMDetails() {
|
||||
System.out.println(VM.current().details());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void printingTheBoolWrapper() {
|
||||
System.out.println(ClassLayout.parseClass(BooleanWrapper.class).toPrintable());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void printingTheBoolArray() {
|
||||
boolean[] value = new boolean[3];
|
||||
|
||||
System.out.println(ClassLayout.parseInstance(value).toPrintable());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.boolsize;
|
||||
|
||||
class BooleanWrapper {
|
||||
private boolean value;
|
||||
}
|
Loading…
Reference in New Issue