Skip to content

Typos and possible content errors in "Garbage Collection in Java" tutorial ( https://dev.java/learn/jvm/tool/garbage-collection/ ) #218

@willy-b

Description

@willy-b

Hello dev.java team!

Thanks again for these excellent tutorials. I write to report a few typos and possible content errors in the "Garbage Collection in Java" tutorial ( https://dev.java/learn/jvm/tool/garbage-collection/ ). At least the following typos/issues are present.


In what is currently the 2nd page of the tutorial, "Garbage Collection in Java" https://dev.java/learn/jvm/tool/garbage-collection/java-specifics/ (archived as is at: https://web.archive.org/web/20260331191516/https://dev.java/learn/jvm/tool/garbage-collection/java-specifics/ ):

  • In the sentence, "The garbage collector doesn't scan each object individually, but insteads starts from "root" objects."

    • "insteads" should be "instead"
  • In the sentence, "Examples of root objects are; local variabes, static class fields, active Java threads, and JNI references.",

    • "variabes" should be "variables" (which local variables specifically are they talking about as root here I wonder)
  • In the sentence, "During the sweep phase all objects that are unreachable, those whose marking bit currently false (0), are removed."

    • "those whose marking bit currently false" should be "those whose marking bit IS currently false"

In the page "Deep-dive of ZGC's Architecture" of the tutorial, https://dev.java/learn/jvm/tool/garbage-collection/zgc-deepdive/ (archived as is at https://web.archive.org/web/20260331193234/https://dev.java/learn/jvm/tool/garbage-collection/zgc-deepdive/ ),
the image illustrating colored pointers and the breakdown of pointer bits used for metadata vs addressing is not consistent with the text:

Image

Specifically:

  const size_t min_address_offset_bits = 42; // 4TB
  const size_t max_address_offset_bits = 44; // 16TB

showing this may be tuned according to the desired max heap size (I think after multiplying by the virtual-to-physical and numa multipliers, see https://github.com/openjdk/jdk/blob/c18e3a3377e67f50ab065d1ac9365c7d43950fb6/src/hotspot/share/gc/z/zAddress.cpp#L154 ). So the text may be describing the 4TB configuration while the diagram shows the 16TB configuration. But there is no reason for the text and diagram to be inconsistent.

Also, it may be useful to add links to the ZGC project itself for such details for further reading, e.g. citing a source for the metadata bit count or colored pointer bits.


Thanks again for everything on this site! I submit these reports in the hope they help avoid confusion for other readers. Feel free to leave this open even if the above items are resolved, as I would be happy to confirm the changes and also report anything else I have found (if anything) during my continued review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions