Skip to content

homework

Luís Falcão edited this page Mar 2, 2024 · 2 revisions

Share your code with user lfalcao-isel in a private Github repository named isel-lae41n-2024-your_number. Create a new folder for each homework.

Homework 01 - Metadata and Objects Layout (28-2-2024)

On folder lesson02/tpc run javap -p apps/Amber.class to analyze the metadata of Amber.class.

  1. Write in Java an equivalent class to the output produced by javap

  2. Make a prediction about the expected layout and size of an instance of the Amber class in the JVM 64-bit model, 8-byte alignment and no compressed references. Save your design in a file amber-layout.txt

  3. Verify your expectations in point 2 comparing it to the result of the output of JOL for Hotspot Layout Simulation (JDK 15, 64-bit model, NO compressed references, NO compressed classes, 8-byte aligned). Run JOL with:

java -cp .;jol-cli-0.17-full.jar org.openjdk.jol.Main estimates apps.Amber

NOTE: Replace ; by : on -cp if you are using a linux-based terminal

Clone this wiki locally