<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Hi Alen,<br>
    <br>
    <div class="moz-cite-prefix">On 2023-11-13 19:05, Alen Vrečko wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CACOdjgQ4uRAa=B=8Ww0wEqYr7EAHev0SQ6TAnXPB_PRPsFeUGw@mail.gmail.com">
      
      <div dir="ltr">Hello everyone,
        <div><br>
        </div>
        <div>o) young gen reference processor</div>
        <div><br>
        </div>
        <div>A bit puzzled by reading in a thread on the list:</div>
        <div><br>
        </div>
        <div>> <span style="color:rgb(0,0,0);white-space:pre-wrap">mentioning that we decided to not ship a young generation reference processor for 21</span><br>
        </div>
        <div><span style="color:rgb(0,0,0);white-space:pre-wrap">
</span></div>
        <div><span style="color:rgb(0,0,0);white-space:pre-wrap">Unless you made changes to ByteBuffer#allocateDirect it uses reference processor to free native memory. If I am not mistaking just using standard library API such as Files.readAllBytes will in some cases do BB#allocateDirect in the internals.</span></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">
</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">Or maybe I am misunderstanding something? I made a toy program and indeed I could easily get a situation where 20% of reference handlers are not called like ever.</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">
</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">This will cause issues for code that is using reference handlers.</span></font></div>
      </div>
    </blockquote>
    <br>
    The reference processing will happen when the GC performs a major
    collection, which collects both the young and old generation. If you
    add a System.gc() you should see that the reference processor is
    kicking in for your program. Could you share your toy program?<br>
    <br>
    <blockquote type="cite" cite="mid:CACOdjgQ4uRAa=B=8Ww0wEqYr7EAHev0SQ6TAnXPB_PRPsFeUGw@mail.gmail.com">
      <div dir="ltr">
        <div><font color="#000000"><span style="white-space:pre-wrap">
</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">o) seeing weird byte[] corruption in production</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">
</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">On CentOS 7 Generational works fine. No issues observed. But on Alma Linux 9.2 either reading byte[] from file or sending byte[] over the network corrupts the byte[]. Didn't investigate at all. Just observed corruption in some cases for some byte[] arrays - not all - just some. On the same Alma Linux 9.2 without generational zgc no byte[] corruption is observed and everything works fine as before.</span></font></div>
      </div>
    </blockquote>
    <br>
    It's hard to say if this is a ZGC bug, compiler bug, OS bug, etc.
    Here are some suggestions for how to help pin-point the problem:<br>
    1) Could you provide the output from 'java -version'?<br>
    2) Is it possible to reproduce this with a small reproducer?<br>
    3) What CPU is this running on?<br>
    4) Does it happen with -XX:UseAVX=0<br>
    5) Do you know the sizes of the corrupted byte[]s? Do you know the
    offset to where it is corrupted?<br>
    <br>
    StefanK<br>
    <br>
    <blockquote type="cite" cite="mid:CACOdjgQ4uRAa=B=8Ww0wEqYr7EAHev0SQ6TAnXPB_PRPsFeUGw@mail.gmail.com">
      <div dir="ltr">
        <div><font color="#000000"><span style="white-space:pre-wrap">
</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">To me Generational ZGC looks more like an experimental feature for now. I am a bit surprised it doesn't require the extra flag to unlock experimental features.</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">
</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">Thanks</span></font></div>
        <div><font color="#000000"><span style="white-space:pre-wrap">Alen</span></font></div>
      </div>
    </blockquote>
    <br>
  </body>
</html>