frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

How ZGC allocates memory for the Java heap

https://joelsiks.com/posts/zgc-heap-memory-allocation/
86•lichtenberger•11mo ago

Comments

gopalv•11mo ago
The 32x virtual memory to physical memory ratio plays into relocation and colored pointers (i.e pointers where some bits serve as flag bits).

Putting the actual data layouts in 44 bits out of 64 is a neat trick which relies on the allocator being aware of the mappings between physical and virtual addresses.

twoodfin•11mo ago
When your comment and the article refer to “physical” addresses, those are physical in the context of the JVM, right? To the OS they’re virtual addresses in the JVM process space?
acchow•11mo ago
Correct. ZGC has no way to escape from the virtualization by the kernel (assuming your hardware and kernel uses an MMU)
MBCook•11mo ago
Thank you for the answer, I was wondering that as well.
hinkley•11mo ago
In the beginning of the 32 bit revolution, when the future was here but unevenly distributed, there was a lot of talk about how 32 bit pointers would fundamentally change how people wrote code. Among other things it got rid of a bunch of odd bookkeeping, and if you don’t have to do the bookkeeping you don’t have to write the code in a way that supports it, so you can do other things.

Not too long after someone asked what sort of interesting changes 64 bit will bring. And I’ve been keeping that question in the back of my mind ever since.

Aliasing memory multiple times in order to do read or write barriers and make GC much cheaper is a pretty good one. But another one I know of is that one of the secrets of the L4 microkernel is that its IPC speed comes substantially from reducing the amount of TLB work that needs to be done to switch to another process running in a different address space. They use the same address space and only swap out the access rights which cuts the call overhead in half. It’s pretty easy to put a bunch of processes into a 64 bit address space and just throw each one a randomly located 4GB slice of RAM.

twoodfin•11mo ago
Yeah, would love to see the CPU vendors invent some primitives to let user code pull those kinds of privilege isolation tricks within a single process and address space.

Something like: “From now on, code on these pages can only access data on these pages, and only return to/call into other code through these gates…”

hinkley•11mo ago
Thread based seems like it at least should be possible.
ahartmetz•11mo ago
I've had some ideas about avoiding format validation in IPC receivers if the data is encoded by trusted code, which is also the only code that has rights to send the IPC data / to connect to the receiver. I can't really think of an important problem that it would solve, though. DBus always validates received data, but it's not really meant or very suitable for large amounts of data anyway.
twoodfin•11mo ago
What I’m looking for is a way for a process to de/re-escalate its privileges to access memory, without an expensive context switch being required at the transition. The CPU would simply enforce different rules based on (say) the high-order bits of the instruction pointer.

Imagine a server process that wants to run some elaborate third-party content parser. It’d be great to be sure that no matter how buggy or malicious that code, it can’t leak the TLS keys.

Today, high-security architectures must use process isolation to achieve this kind of architectural guarantee, but even finely tuned IPC like L4’s is an order of magnitude slower than a predictable jump.

gpderetta•11mo ago
For a brief moment Intel supported MPX which did something similar.

You can also play tricks with the virtualization hardware, bit it need kernel support.

Eventually we will get segments back again.

MarkSweep•11mo ago
That would be pretty cool. Something like the Win32 function GetWriteWatch, but implemented in hardware instead of the page fault handler (I assume).

https://learn.microsoft.com/en-us/windows/win32/api/memoryap...

Or some sort of special write barrier store op-code, idk.

mike_hearn•11mo ago
It exists, that's called MPKs.
twoodfin•11mo ago
I don’t think MPK’s will fit the need I have. Simply: Run some arbitrary, untrusted, non-sandboxed code in the same thread with assurance it can’t read page X. When that code completes and I’m back in code I trust, X is readable again.

Is that something MPK makes possible? The doc I’ve read suggests either your process can flip permission bits or it can’t. Great for avoiding out-of-sandbox reads. But if there’s arbitrary execution happening, why can’t that code flip the access to secrets back on?

mike_hearn•11mo ago
Oracle Labs has tech that does that:

https://youtu.be/T05FI93MBI8?si=EieFgujaGiW2gbO8&t=958

The trick is to do a cascading disassembly of all untrusted code you'll execute to prove it can't change the MPK register.

twoodfin•11mo ago
Wow. Neat trick and exactly the kind of thing I was looking for.

Thanks!

EDIT: Looks like this is the relevant paper from the Graal team: https://www.graalvm.org/resources/articles/binsweep.pdf

jdougan•11mo ago
Is that something like the memory protection scheme on the Newton OS?
nyanpasu64•11mo ago
Isn't not swapping page tables during a call precisely what the KPTI mitigations had to turn off for Meltdown mitigations?
pron•11mo ago
For relevant upcoming changes see Automatic Heap Sizing for ZGC: https://openjdk.org/jeps/8329758

Project Glasswing: Securing critical software for the AI era

https://www.anthropic.com/glasswing
1086•Ryan5453•11h ago•496 comments

Lunar Flyby

https://www.nasa.gov/gallery/lunar-flyby/
539•kipi•14h ago•127 comments

Protect Your Shed

https://dylanbutler.dev/blog/protect-your-shed/
63•baely•2h ago•9 comments

Slightly safer vibecoding by adopting old hacker habits

http://addxorrol.blogspot.com/2026/03/slightly-safer-vibecoding-by-adopting.html
51•transpute•5d ago•22 comments

Native Americans had dice 12k years ago

https://www.nbcnews.com/science/science-news/native-americans-dice-games-probability-study-rcna26...
30•delichon•4d ago•4 comments

System Card: Claude Mythos Preview [pdf]

https://www-cdn.anthropic.com/53566bf5440a10affd749724787c8913a2ae0841.pdf
621•be7a•11h ago•447 comments

GLM-5.1: Towards Long-Horizon Tasks

https://z.ai/blog/glm-5.1
473•zixuanlimit•13h ago•189 comments

Binary obfuscation used in AAA Games

https://blog.farzon.org/2026/04/binary-obfuscation-that-doesnt-kill-lto.html
53•noztol•2d ago•13 comments

How to get better at guitar

https://www.jakeworth.com/posts/how-to-get-better-at-guitar/
256•jwworth•2d ago•124 comments

S3 Files

https://www.allthingsdistributed.com/2026/04/s3-files-and-the-changing-face-of-s3.html
254•werner•9h ago•72 comments

Cambodia unveils statue to honour famous landmine-sniffing rat

https://www.bbc.com/news/articles/c0rx7xzd10xo
337•speckx•12h ago•68 comments

A truck driver spent 20 years making a scale model of every building in NYC

https://www.smithsonianmag.com/smart-news/a-truck-drive-spent-20-years-making-this-astonishing-sc...
293•1659447091•2d ago•46 comments

Show HN: An interactive map of Tolkien's Middle-earth

https://middle-earth-interactive-map.web.app/
138•frasermarlow•8h ago•27 comments

A database of analog cameras that can be 3D printed

https://printed.analogcamera.space/
72•thomasjb•4d ago•8 comments

US and Iran agree to provisional ceasefire

https://www.theguardian.com/us-news/2026/apr/07/trump-iran-war-ceasefire
362•g-b-r•6h ago•977 comments

Show HN: Brutalist Concrete Laptop Stand (2024)

https://sam-burns.com/posts/concrete-laptop-stand/
728•sam-bee•18h ago•222 comments

The Clock

https://blog.senko.net/the-clock
40•senko•3d ago•6 comments

Xilem – An experimental Rust native UI framework

https://github.com/linebender/xilem
55•Levitating•5h ago•15 comments

Cloudflare targets 2029 for full post-quantum security

https://blog.cloudflare.com/post-quantum-roadmap/
301•ilreb•15h ago•95 comments

ACE on a USB→HDMI Adapter

https://blazelight.dev/blog/ms2160.mdx
4•theblazehen•3d ago•1 comments

A whole boss fight in 256 bytes

https://hellmood.111mb.de//A_whole_boss_fight_in_256_bytes.html
82•HellMood•2d ago•20 comments

Show HN: Gemma 4 Multimodal Fine-Tuner for Apple Silicon

https://github.com/mattmireles/gemma-tuner-multimodal
148•MediaSquirrel•9h ago•22 comments

LLM scraper bots are overloading acme.com's HTTPS server

http://acme.com/updates/archive/229.html
27•mjyut•2h ago•22 comments

JSIR: A High-Level IR for JavaScript

https://discourse.llvm.org/t/rfc-jsir-a-high-level-ir-for-javascript/90456
30•nnx•4h ago•7 comments

Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

https://printervention.app/details
174•gmac•12h ago•79 comments

The Image Boards of Hayao Miyazaki

https://animationobsessive.substack.com/p/the-image-boards-of-hayao-miyazaki
146•vinhnx•1d ago•14 comments

Google open-sources experimental agent orchestration testbed Scion

https://www.infoq.com/news/2026/04/google-agent-testbed-scion/
177•timbilt•15h ago•48 comments

Running out of disk space in production

https://alt-romes.github.io/posts/2026-04-01-running-out-of-disk-space-on-launch.html
176•romes•4d ago•89 comments

A blind man made it possible for others with low vision to build Lego sets

https://apnews.com/article/lego-bricks-for-blind-audio-braille-instructions-5a2a27de4354a0b144317...
66•speckx•15h ago•5 comments

Bitcoin and quantum computing

https://nehanarula.org/2026/04/03/bitcoin-and-quantum-computing.html
125•nehan•8h ago•89 comments