3 ms·
Good to know, I knew that I could choose different ones at runtime via java args, but unaware there was a runtime interface. I see cpp code at [0] and some adja
by kodablah 8y ago
Good to know, I knew that I could choose different ones at runtime via java args, but unaware there was a runtime interface. I see cpp code at [0] and some adjacent impls. is there a single C-level h file or is it cpp only? Any hello-world trivial impl?
0 - http://hg.openjdk.java.net/jdk/jdk11/file/a0de9a3a6766/src/hotspot/share/gc/shared http://hg.openjdk.java.net/jdk/jdk11/file/a0de9a3a6766/src/h...
- pjmlp 8y agoYou are looking for "JEP 304: Garbage Collector Interface". http://openjdk.java.net/jeps/304 http://openjdk.java.net/jeps/304 Naturally this is OpenJDK specific, other JVMs might do it differently.
- mike_hearn 8y agoThe hello world collector is called Epsilon. Epsilon is the simplest possible collector: it never collects at all. The next one up in complexity is called the serial collector. It's a stop the world mark/sweep design straight out of the 1980s, but it can be quite effective for small programs like command line tools, simple GUI apps etc because there's no heap overhead and no runtime overhead when not collecting. After that you get into the more advanced algorithms. In order they'd be parallel, CMS, G1, Shenandoah/ZGC. The different engines can be found one level up, here: http://hg.openjdk.java.net/jdk/jdk11/file/a0de9a3a6766/src/hotspot/share/gc/ http://hg.openjdk.java.net/jdk/jdk11/file/a0de9a3a6766/src/h... The directory you were looking at is code shared between the collectors.
- kodablah 8y agoAh yes, I saw the adjacent impls, didn't check deeper to see Epsilon was exactly what I was looking for. Thanks. I see even the ifaces are GPL sadly as are the impls. I am not sure the classpath exception applies to the interfaces. And I fear even reading/learning from the impls lest I want to use my GPL-gained knowledge on a distributed, non-GPL project.
- mike_hearn 8y agoGPL doesn't affect knowledge, only code. You can go work on proprietary software using things you learned by reading GPLd code, don't worry about that.