News for hackers. Stuff that matters.
Re:Revisiting the DOS Memory Models by xxs on Tuesday November 26, 2024 @02:16AM (#42243258)
All allocated objects would have the three least significant bits as 0. Any java object cannot be 'too small' as they all have object headers (more if you need a fully blown synchronized/mutex). So with compressed pointers (up to 32GB Heaps) all objects are aligned but then again, each pointer is 4 bytes only (instead of 8). Overall it's a massive win.
Re:Revisiting the DOS Memory Models by kstrauser on Tuesday November 26, 2024 @11:03AM (#42246858)
Huh, that’s clever! Do you have to choose that at compile or launch time, or does a program start like that and then “grow” when it uses more than 32GB of heap?
Re:Revisiting the DOS Memory Models by xxs on Tuesday November 26, 2024 @12:52PM (#42248007)
In Java you have to set max heap somehow - either ergonomics or just -Xmx command line option. Max heap is given (many a reason, and it sets before running the main method), so if you pick under the 32GB it'd auto use compressed pointers (optimize for size - optimize for speed). That option (compressed pointers) can be switched off, of course, via a command line option as well.