Bending pause times to your will with Generational ZGC
https://netflixtechblog.com/bending-pause-times-to-your-will-with-generational-zgc-256629c9386b [netflixtechblog.com]
2024-03-16 00:20
tags:
garbage-collection
java
perf
The latest long term support release of the JDK delivers generational support for the Z Garbage Collector. Netflix has switched by default from G1 to Generational ZGC on JDK 21 and later, because of the significant benefits of concurrent garbage collection.
source: HN
A world to win - WebAssembly for the rest of us
https://www.wingolog.org/archives/2023/03/20/a-world-to-win-webassembly-for-the-rest-of-us [www.wingolog.org]
2023-03-20 22:09
tags:
functional
garbage-collection
lisp
programming
transcript
wasm
As it turns out, there is a reason that there is no good Scheme implementation on WebAssembly: the initial version of WebAssembly is a terrible target if your language relies on the presence of a garbage collector. There have been some advances but this observation still applies to the current standardized and deployed versions of WebAssembly. To better understand this issue, let’s dig into the guts of the system to see what the limitations are.
source: HN
Unsafe string interning in Go
https://mdlayher.com/blog/unsafe-string-interning-in-go/ [mdlayher.com]
2020-12-30 22:50
tags:
garbage-collection
go
programming
The result of this work is the package go4.org/intern which uses some pretty neat unsafe tricks to implement efficient string interning using weak references and Go finalizers. We’ll start by showing off the safe implementation and gradually introduce the concepts needed to understand the unsafe one as well.
source: L
.NET Memory Performance Analysis
https://github.com/Maoni0/mem-doc/blob/master/doc/.NETMemoryPerformanceAnalysis.md [github.com]
2020-09-10 02:58
tags:
development
dotnet
garbage-collection
investigation
malloc
perf
This document aims to help folks who develop applications in .NET with how to think about memory performance analysis and finding the right approaches to perform such analysis if they need to. In this context .NET includes .NET Framework and .NET Core. In order to get the latest memory improvements in both the garbage collector and the rest of the framework I strongly encourage you to be on .NET Core if you are not already, because that’s where the active development happens.
When I was writing this document I intended to introduce concepts like concurrent GC or pinning as needed by the explanation of the analysis. So as you read it, you’ll gradually come across them. If you already kind of knew what they are and are looking for explanation on a specific concept here are the links to them
source: HN
A Massive Leak
https://thedailywtf.com/articles/a-massive-leak [thedailywtf.com]
2020-08-05 01:04
tags:
bugfix
corner
csharp
garbage-collection
networking
“Memory leaks are impossible in a garbage collected language!” is one of my favorite lies. It feels true, but it isn’t. Sure, it’s much harder to make them, and they’re usually much easier to track down, but you can still create a memory leak. Most times, it’s when you create objects, dump them into a data structure, and never empty that data structure. Usually, it’s just a matter of finding out what object references are still being held. Usually.
A few months ago, I discovered a new variation on that theme. I was working on a C# application that was leaking memory faster than bad waterway engineering in the Imperial Valley.
Fixing memory leaks in web applications
https://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/ [nolanlawson.com]
2020-02-21 15:33
tags:
garbage-collection
javascript
programming
web
Part of the bargain we struck when we switched from building server-rendered websites to client-rendered SPAs is that we suddenly had to take a lot more care with the resources on the user’s device. Don’t block the UI thread, don’t make the laptop’s fan spin, don’t drain the phone’s battery, etc. We traded better interactivity and “app-like” behavior for a new class of problems that don’t really exist in the server-rendered world.
One of these problems is memory leaks. A poorly-coded SPA can easily eat up megabytes or even gigabytes of memory, continuing to gobble up more and more resources, even as it’s sitting innocently in a background tab. At this point, the page might start to slow to a crawl, or the browser may just terminate the tab and you’ll see Chrome’s familiar “Aw, snap!” page.
Go memory ballast: How I learnt to stop worrying and love the heap
https://blog.twitch.tv/en/2019/04/10/go-memory-ballast-how-i-learnt-to-stop-worrying-and-love-the-heap-26c2462549a2/ [blog.twitch.tv]
2019-12-02 05:51
tags:
garbage-collection
go
perf
programming
The heap size is the total size of allocations on the heap. Therefore, if a ballast of 10 GiB is allocated, the next GC will only trigger when the heap size grows to 20 GiB. At that point, there will be roughly 10 GiB of ballast + 10 GiB of other allocations.
source: HN
The story of a V8 performance cliff in React
https://v8.dev/blog/react-cliff [v8.dev]
2019-08-29 18:15
tags:
garbage-collection
javascript
jit
perf
programming
type-system
Previously, we discussed how JavaScript engines optimize object and array access through the use of Shapes and Inline Caches, and we’ve explored how engines speed up prototype property access in particular. This article describes how V8 chooses optimal in-memory representations for various JavaScript values, and how that impacts the shape machinery — all of which helps explain a recent V8 performance cliff in React core.
source: L
Efficient Go APIs with the mid-stack inliner
https://blog.filippo.io/efficient-go-apis-with-the-inliner/ [blog.filippo.io]
2019-07-18 17:09
tags:
garbage-collection
go
malloc
perf
programming
A common task in Go API design is returning a byte slice. In this post I will explore some old techniques and a new one.
Trash talk: the Orinoco garbage collector
https://v8.dev/blog/trash-talk [v8.dev]
2019-06-18 05:54
tags:
concurrency
garbage-collection
javascript
perf
programming
Over the past years the V8 garbage collector (GC) has changed a lot. The Orinoco project has taken a sequential, stop-the-world garbage collector and transformed it into a mostly parallel and concurrent collector with incremental fallback.
source: L
Trashing the Flow of Data
https://googleprojectzero.blogspot.com/2019/05/trashing-flow-of-data.html [googleprojectzero.blogspot.com]
2019-05-12 15:02
tags:
development
exploit
garbage-collection
javascript
jit
malloc
security
In this blog post I want to present crbug.com/944062, a vulnerability in Chrome’s JavaScript compiler TurboFan that was discovered independently by Samuel (saelo@) via fuzzing with fuzzilli, and by myself via manual code auditing. The bug was found in beta and was fixed before it made it into the stable release of Chrome, but I think it’s interesting for a few reasons and decided to write about it. The issue was in TurboFan’s handling of the Array.indexOf builtin and at first it looked like an info leak at best, so it was not clear that you can turn this into an arbitrary write primitive. Besides that, it’s an instance of a common bug pattern in JIT compilers: the code was making assumptions at compile time without inserting the corresponding runtime checks for these assumptions.
As has been shown many times before, often bugs that don’t seem exploitable at first can be turned into an arbitrary read/write. In this case in particular, triggering the garbage collector while our fake pointer was on the stack gave us a very strong exploitation primitive. The V8 team fixed the bug very quickly as usual. But more importantly, they’re planning to refactor the InferReceiverMaps function to prevent similar bugs in the future. When I noticed this function in the past, I was convinced that one of the callers will get it wrong and audited all the call sites. Back then I couldn’t find a vulnerability but a few months later I stumbled over this newly introduced code that didn’t add the right runtime checks. In hindsight, it would have been worthwhile to point out this dodgy API to the team even without vulnerabilities to show for.
A new runtime for Nim
https://nim-lang.org/araq/ownedrefs.html [nim-lang.org]
2019-03-27 22:35
tags:
garbage-collection
malloc
nim
programming
type-system
In this blog post I explore how the full Nim language can be used without a tracing garbage collector. Since strings and sequences in Nim can also be implemented with destructors the puzzle to solve is what to do with Nim’s ref pointers and new keyword.
Type-specific allocation turns every “use after free” bug into a logical bug but no memory corruption can happen. So ... we have already accomplished “memory safety without a GC”. It didn’t require a borrow checker nor an advanced type system. It is interesting to compare this to an example that uses array indexing instead of pointers:
Interesting approach.
source: L
Exploring how and why interior pointers in Go keep entire objects alive
https://utcc.utoronto.ca/~cks/space/blog/programming/GoInteriorPointerGC [utcc.utoronto.ca]
2019-03-09 07:06
tags:
garbage-collection
go
intro-programming
Today, with indivisible compound objects, Go can keep a simple map from memory addresses to the block of memory that they keep alive and the garbage collector doesn’t have to care about the type of a pointer, just its address, because the address alone is what determines how much memory is kept alive. In a world where compound objects are divisible, we must somehow arrange for &b.smallThing and &b to be treated differently by the garbage collector, either by giving the garbage collector access to type information or by having them point to different addresses.
JVM Anatomy Quark #23: Compressed References
https://shipilev.net/jvm/anatomy-quarks/23-compressed-references/ [shipilev.net]
2019-03-06 05:59
tags:
garbage-collection
java
malloc
But does that mean the size of Java reference is the same as the machine pointer width? Not necessarily. Java objects are usually quite reference-heavy, and there is pressure for runtimes to employ the optimizations that make the references smaller. The most ubiquitous trick is to compress the references: make their representation smaller than the machine pointer width.
source: HN
PyPy for low-latency systems
https://morepypy.blogspot.com/2019/01/pypy-for-low-latency-systems.html [morepypy.blogspot.com]
2019-01-03 22:11
tags:
garbage-collection
perf
python
update
Recently I have merged the gc-disable branch, introducing a couple of features which are useful when you need to respond to certain events with the lowest possible latency.
source: HN
Common Mistakes about Generational Garbage Collection
https://orbifold.xyz/garbage.html [orbifold.xyz]
2018-11-30 05:10
tags:
garbage-collection
To summarize: please choose your words carefully. “Young objects are more likely to die” is an accurate motivation, “Most objects die young” is not. This goes doubly if you do understand the subtlety: do not assume the people you are talking with have an accurate model of how garbage works.
source: L
The benefits and costs of writing a POSIX kernel in a high-level language
https://www.usenix.org/conference/osdi18/presentation/cutler [www.usenix.org]
2018-10-09 02:54
tags:
garbage-collection
go
paper
pdf
perf
systems
The paper contributes Biscuit, a kernel written in Go that implements enough of POSIX (virtual memory, mmap, TCP/IP sockets, a logging file system, poll, etc.) to execute significant applications. Biscuit makes lib- eral use of Go’s HLL features (closures, channels, maps, interfaces, garbage collected heap allocation), which sub- jectively made programming easier. The most challenging puzzle was handling the possibility of running out of ker- nel heap memory; Biscuit benefited from the analyzability of Go source to address this challenge.
Good enough to run nginx.
https://github.com/mit-pdos/biscuit
source: HN
Java's new Z Garbage Collector (ZGC) is very exciting
https://www.opsian.com/blog/javas-new-zgc-is-very-exciting/ [www.opsian.com]
2018-09-12 18:09
tags:
beta
garbage-collection
java
perf
programming
Java 11 has recently been feature frozen and contains some really great features, one in particular we’d like to highlight. The release contains a brand new Garbage Collector, ZGC, which is being developed by Oracle that promises very low pause times on multi-terabyte heaps. In this article we’ll cover the motivation for a new GC, a technical overview and some of the really exciting possibilities ZGC opens up.
source: L
Allocator Wrestling
https://about.sourcegraph.com/go/gophercon-2018-allocator-wrestling/ [about.sourcegraph.com]
2018-08-31 16:01
tags:
garbage-collection
go
malloc
perf
programming
A whirlwind tour of the Go memory allocator and garbage collector, with tools and tips on how to optimize.
Rather deep for a whirlwind tour.
source: L
Getting to Go
https://blog.golang.org/ismmkeynote [blog.golang.org]
2018-07-18 00:02
tags:
concurrency
garbage-collection
go
paper
perf
programming
systems
This is the transcript from the keynote I gave at the International Symposium on Memory Management (ISMM) on June 18, 2018. For the past 25 years ISMM has been the premier venue for publishing memory management and garbage collection papers and it was an honor to have been invited to give the keynote.