Domanda

Here's a rough translation of a tweet by @xharaken.

"Space rays hit computers and mess up the bits in the memory" "hardware bugs mess up the bits in the memory" such things almost never happen, but they happen on a nearly daily basis when there are so many users using a software like [Google] Chrome. So the GC running inside Chrome has a function to check such bit anomalies.

The original:

「宇宙線が降ってきてメモリのビットが狂う」「ハードウェアのバグでメモリのビットが狂う」というのは非常にまれな現象だけど、Chromeくらいのユーザ数規模になるとけっこう日常的に起きます。なのでChromeで走ってるGCには、それらのビット異常を検知する機構をわざわざ入れてます。

I do understand that such weird errors happen, but I don't understand how or why checking such errors is important in writing a garbage collector. What I thought was the job of garbage collectors have nothing to do with data integrity in the memory. Think about it - what a garbage collector does is it wipes data in the memory that are no longer referenced. Weird bugs caused by random memory bugs is not in a, at least, say, obvious way, related to a garbage collector's job.

È stato utile?

Soluzione

In any complex, memory-intensive application, random bit errors can be hellishly hard to debug. Anything that helps you detecting them is very useful when your software is deployed to millions of devices. A garbage collector is simply the point where adding functionality to detect such errors produces the smallest overhead and has a good chance of succeeding, because it's the garbage collector's job to constantly inspect the application's memory anyway.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
scroll top