2 ms·
I found this a little confusing. The article contains several simplistic examples of garbage collection algorithms - written in Java! A tantalisingly meta conce
by beachy 2y ago
I found this a little confusing. The article contains several simplistic examples of garbage collection algorithms - written in Java! A tantalisingly meta concept, but snatched away half way through when the article clarifies that of course you can't write your own garbage collection in Java and plug it into the JVM. You need native code.
Another nit is that at the top of the article is a link to another article on "Understanding How to Use Cryptography in Java" which is claimed to be "a good starting point to taking on this adventure." Personally I could not see any connection between the two subjects, which made me feel that some editor type stuffed that in there in an attempt to juice their page views.
- anta40 2y agoI guess this is a sort of gentle introduction to "how GC works" for Java devs. For more realistic usage, perhaps poking the Boehm-Demers-Weiser or the likes is better, unless you want to hack the JVM code, because the GC API isn't exposed to developers.
- xxs 2y agoIt lacks any concurrency handling, even though there is a section about it. The attempt to use some, e.g. RefCountedObject, performs a proper transgression - 'data' field being non-volatile and modified within a synchronized block but read outside.