Difference between background and concurrent garbage collection?

Here, Microsoft uses the names “concurrent” and “background” to describe two versions of the GC it uses in .NET. In the .NET world, the “background collector” is an enhancement over the “concurrent collector” in that it has less restrictions on what application threads can do while the collector is running. A basic GC uses a … Read more

JavaScript: remove an event listener from within that listener?

You can pass the once option to have a listener act only once, then remove itself. Docs: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters Example: element.addEventListener(‘eventname’, (ev) => { console.log(“event is captured only once.”); // do more stuff… }, { once: true }); From the same docs link above, modern browser support is good, but is not available for Internet Explorer.

Should we use “workstation” garbage collection or “server” garbage collection?

It’s not explained very well, but as far as I can tell, the server mode is synchronous per core, while the workstation mode is asynchronous. In other words, the workstation mode is intended for a small number of long running applications that need consistent performance. The garbage collection tries to “stay out of the way” … Read more

Replacing finalize() in Java

Java 9 introduces the Cleaner and Cleanable utility classes which take care of wiring up phantom references to a queue and a cleaning thread draining that queue. While this lets you separate out the witness that will perform a post-mortem cleanup after the owning object has died, all the caveats about GC-triggered resource management still … Read more

tech