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

Founder of GitLab battles cancer by founding companies

https://sytse.com/cancer/
515•bob_theslob646•4h ago•125 comments

CSS is DOOMed

https://nielsleenheer.com/articles/2026/css-is-doomed-rendering-doom-in-3d-with-css/
77•msephton•1h ago•27 comments

Further human + AI + proof assistant work on Knuth's "Claude Cycles" problem

https://twitter.com/BoWang87/status/2037648937453232504
112•mean_mistreater•3h ago•70 comments

Linux is an interpreter

https://astrid.tech/2026/03/28/0/linux-is-an-interpreter/
139•frizlab•5h ago•22 comments

AI overly affirms users asking for personal advice

https://news.stanford.edu/stories/2026/03/ai-advice-sycophantic-models-research
470•oldfrenchfries•8h ago•366 comments

I decompiled the White House's new app

https://thereallo.dev/blog/decompiling-the-white-house-app
309•amarcheschi•6h ago•110 comments

The first 40 months of the AI era

https://lzon.ca/posts/other/thoughts-ai-era/
65•jpmitchell•3h ago•5 comments

InpharmD (YC W21) Is Hiring – Senior Ruby on Rails Developer

https://inpharmd.com/jobs/senior-ruby-on-rails-engineer
1•tulasichintha•57m ago

OpenCiv1 – open-source rewrite of Civ1

https://github.com/rajko-horvat/OpenCiv1
47•caminanteblanco•4h ago•5 comments

I Built an Open-World Engine for the N64 [video]

https://www.youtube.com/watch?v=lXxmIw9axWw
312•msephton•10h ago•44 comments

1929: Inside the Greatest Crash in Wall Street History

https://www.nybooks.com/articles/2026/03/26/tick-tick-boom-1929-andrew-ross-sorkin/
21•mitchbob•3d ago•23 comments

Undroidwish – a single-file, batteries-included Tcl/Tk binary for many platforms

https://androwish.org/home/wiki?name=undroidwish
51•smartmic•5h ago•3 comments

Meta Partners with Arm to Develop New Class of Data Center Silicon

https://about.fb.com/news/2026/03/meta-partners-with-arm-to-develop-new-class-of-data-center-sili...
12•eatonphil•4d ago•1 comments

Cocoa-Way – Native macOS Wayland compositor for running Linux apps seamlessly

https://github.com/J-x-Z/cocoa-way
283•OJFord•12h ago•91 comments

Private equity turned vulnerable elderly people into human ATMs

https://www.theguardian.com/society/2026/mar/28/the-great-care-home-cash-grab-how-private-equity-...
27•mordechai9000•50m ago•8 comments

Detecting file changes on macOS with kqueue

https://www.vegardstikbakke.com/kqueue/
50•benhoyt•4d ago•7 comments

Spanish legislation as a Git repo

https://github.com/EnriqueLop/legalize-es
668•enriquelop•10h ago•203 comments

CERN uses ultra-compact AI models on FPGAs for real-time LHC data filtering

https://theopenreader.org/Journalism:CERN_Uses_Tiny_AI_Models_Burned_into_Silicon_for_Real-Time_L...
287•TORcicada•14h ago•128 comments

Circuit-level PDP-11/34 emulator

https://github.com/dbrll/ll-34
40•elvis70•6h ago•4 comments

rpg.actor Game Jam

https://rpg.actor/jam
54•Kye•6h ago•5 comments

Go hard on agents, not on your filesystem

https://jai.scs.stanford.edu/
567•mazieres•21h ago•304 comments

C++26: A User-Friednly assert() macro

https://www.sandordargo.com/blog/2026/03/25/cpp26-user-friendly-assert
57•jandeboevrie•3d ago•41 comments

ICAO issued new power bank restriction on flight

https://www.icao.int/news/new-power-bank-restrictions-will-safeguard-international-aviation
49•phantomathkg•8h ago•63 comments

Improved Git Diffs with Delta, Fzf and a Little Shell Scripting

https://nickjanetakis.com/blog/awesome-git-diffs-with-delta-fzf-and-a-little-shell-scripting
103•nickjj•4d ago•33 comments

Ötzi the Iceman's DNA Reveals a Living Relative 5k Years Later

https://blog.familytreedna.com/otzi-the-iceman-dna/
5•ilamont•1h ago•0 comments

Google just gave Android power users a sideloading win

https://www.androidauthority.com/android-sideload-carry-over-3652845/
30•croemer•2h ago•24 comments

Hacking old hardware by renaming to .zip [video]

https://www.youtube.com/watch?v=P1kfuCkWo24
91•abadar•3d ago•69 comments

AMD's Ryzen 9 9950X3D2 Dual Edition crams 208MB of cache into a single chip

https://arstechnica.com/gadgets/2026/03/amds-ryzen-9-9950x3d2-dual-edition-crams-208mb-of-cache-i...
290•zdw•20h ago•159 comments

StationeryObject

https://stationeryobject.com/archive/
36•NaOH•3d ago•1 comments

Paper Tape Is All You Need – Training a Transformer on a 1976 Minicomputer

https://github.com/dbrll/ATTN-11
125•rahen•3d ago•21 comments