JDK-8199916 : (bf) Limit size of bulk copies to allow VM to safepoint
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 11
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-03-21
  • Updated: 2019-02-04
Description
A DESCRIPTION OF THE REQUEST :
JNI critical regions can starve garbage collectors and create time to safepoint (TTSP) issues. Previously java.nio.Bits would copy 1MB chunks in a JNI critical region, but in the change to unsafe.copyMemory the copy no longer uses chunks.

This thread discusses the issue and unsafe.copyMemory:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-March/051898.html

RFE 9053049 asks that long JNI critical regions generate warnings when longer than some threshold.

JUSTIFICATION :
TTSP is described as a silent killer:
https://groups.google.com/d/msg/mechanical-sympathy/f3g8pry-o1A/x6NptTDslcIJ
Without the chunking, or loop strip mining, the JDK libraries create TTSP issues - or potentially do when inputs are large.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Fewer TTSP problems, as could be diagnosed with RFE 9053048.
ACTUAL -
Large copies, decompression, etc. can yield TTSP issues that effect tail latency on network servers.