An interesting fact is that the hotspot team went back on their 20-year conviction that load-barriers reduce performance too much. I guess improvements in CPU and VM designs has changed their minds. This is a big deal, and a major departure. I'm hoping this will improve things, this new architecture more closely resembles Azul's C4. Java and large heaps with non-conforming object allocation patterns (medium aged obje…
Java’s new garbage collector promises low pause times on multi-terabyte heaps
221–230 of 245 posts
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#222Earlier quoted context omitted.
> Our legal system is such that Oracle can still burn you down, even if you are right. Do you happen to know of any real-world case that's similar to the scenario you've described?
Google v Oracle comes to mind.
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#223Earlier quoted context omitted.
Agreed - I'd go farther to say it only works for addresses in the userspace half, so on Linux you lose an extra bit and only get 47 (I don't know how the mappings are setup for Windows/OSX, sorry). It also might be worth pointing out that you now need 16x the page mappings (Since every mapping needs 15 duplicates for the possible flag states) - I don't know how Java does it's memory management but if it does lots of…
> It also might be worth pointing out that you now need 16x the page mappings (Since every mapping needs 15 duplicates for the possible flag states) Nope. They went into this in the article: > Since by design only one of remap, mark0 and mark1 can be 1 at any point in time, it’s possible to do this with three mappings. There’s a nice diagram[1] in the ZGC source for this. [1]: http://hg.openjdk.java.net/zgc/zgc/file/…
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#224Earlier quoted context omitted.
This is true, but it mainly just mitigates the problem. It can never solve the problem, because the whole concept of this kind of scheme is that the memory manager has some volition of its own ... thus it can choose to do things when you don't want or expect (actually this is unavoidable). Also note that this category of answer is basically saying, "look, if you mostly manage your own memory, then GC takes less time!…
> That's true, but a large part of the value proposition of GC in the first place was to remove the burden of memory management. This is a good point. I've spent a fair amount of time trying to build performant stuff on the web, and my conclusion has been that if you really care about memory management, garbage collection is not your friend. You spend more time than is necessary trying to convince the engine not to a…
Do you have any good references you can share regarding Chrome's garbage collection? This is a topic I would like to learn more about.
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#225Earlier quoted context omitted.
> That's true, but a large part of the value proposition of GC in the first place was to remove the burden of memory management. This is a good point. I've spent a fair amount of time trying to build performant stuff on the web, and my conclusion has been that if you really care about memory management, garbage collection is not your friend. You spend more time than is necessary trying to convince the engine not to a…
> I have spent more time learning about how Chrome's garbage collection works than I would have ever spent manually tracking references myself. Do you have any good references you can share regarding Chrome's garbage collection? This is a topic I would like to learn more about.
At some point in the future I will probably write a blog post about good techniques for taking back control of JS memory management from the browser, but it probably won't be for a while.
The short answer though is that browsers try to defer garbage collection until it looks like the page isn't doing much; and the problem is that games don't ever really stop doing stuff. This encourages the browser to put off garbage collection and handle it in chunks, which in turn leads to dropped frames because you're doing a lot of deallocation at once.
This is why if you profile a Chrome app that's doing a lot of allocations very quickly, your memory usage will kind of sawtooth all over the place. And you get around that by getting rid of as many allocations as possible.
IMO the lack of garbage collection in WASM is the most exciting thing about it, but different languages have different tradeoffs and WASM isn't appropriate for every application.
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#226Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#227Earlier quoted context omitted.
This sort of stalling is only caused by extremely short lived objects. Pooling and provisioning your data ahead of time goes a long way to fixing these specific issues to the degree that they become unnoticeable. There's a lot of tooling built into LWJGL to support this along with their own vector classes which are easily reclaimed. Also has it really been a decade since Braid? Wow.
Wait, why have a GC if you're going to work around it and end up with manual memory management anyways?
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#228Earlier quoted context omitted.
He's just trying to bash Java. HN readers hate Java for some reason.
Everyone I know in tech hates Java. They've all had to suffer through terrible poorly-performing Java desktop apps (or worse, applets) which has tainted the image of the language for a generation.
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#229Earlier quoted context omitted.
I worked for a company where we had a 100-150 microseconds order latency. We had to tune jvm to extremes. But it is very doable to optimize Java gc for low gc pause times.
If you used to tune JVM only, that might be interesting. Most often the Java code is what being tuned - to the point where there is no point to use Java - with (almost) no gc, off-the-heap memory allocations and all that jazz.
You can go even further and employ what's called mechanical sympathy (https://mechanical-sympathy.blogspot.com/) and write your code in a way that makes it easier for the processor to process faster.
I've never worked with application that use off-heap allocations or no-gc requirements.
Re: Java’s new garbage collector promises low pause times on multi-terabyte heaps
#230Earlier quoted context omitted.
This sort of stalling is only caused by extremely short lived objects. Pooling and provisioning your data ahead of time goes a long way to fixing these specific issues to the degree that they become unnoticeable. There's a lot of tooling built into LWJGL to support this along with their own vector classes which are easily reclaimed. Also has it really been a decade since Braid? Wow.
This is true, but it mainly just mitigates the problem. It can never solve the problem, because the whole concept of this kind of scheme is that the memory manager has some volition of its own ... thus it can choose to do things when you don't want or expect (actually this is unavoidable). Also note that this category of answer is basically saying, "look, if you mostly manage your own memory, then GC takes less time!…