Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8201826

G1: Don't invoke WeakProcessor if mark stack has overflowed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 11
    • None
    • hotspot
    • gc
    • b11
    • generic
    • generic

    Description

      I noticed this snippet in g1ConcurrentMark.cpp:

      1706 if (has_overflown()) {
      1707 // We can not trust g1_is_alive if the marking stack overflowed
      1708 return;
      1709 }

      This was added by JDK-8036673.

      And the comment is correct; if the mark stack overflows then g1_is_alive (a G1CMIsAliveClosure) can return false for a live object. (Said overflow and wrong answer can only happen because of soft reference phase1 or finalizer reference processing, as those are the only cases where previously unknown live objects can be found during reference processing.)

      But all the j.l.r.Reference processing and the JNI &etc weak processing preceed that check. Even after the JNI &etc weak processing was moved from ReferenceProcessor to WeakProcessor, the WeakProcessor invocation was placed between the ReferenceProcessor work and the overflow check.

      The WeakProcessor invocation should be moved to after the overflow check.

      Attachments

        Issue Links

          Activity

            People

              kbarrett Kim Barrett
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: