Java object memory consumption depends on the machine architecture. On 32-bit machines, each object header uses one 32-bit and one 64-bit word, while 64-bit machines with heaps above 32 GB use two 64-bit words. Alignment padding adds further overhead — for example, a 32-bit integer on a 64-bit machine with a large heap requires six 32-bit words total. Two JVM projects address this: Project Lilliput (reducing header size) and Project Valhalla (eliminating headers for value objects).

1m watch time
331 Impressions