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

SecureRandom.nextBytes() hurts performance with small size requests

    Details

      Backports

        Description

        Server threads were shown to be blocked and timeout during PAE testing. This showed up more in smaller heap sizes. Pulling many bytes and buffering would help this.

        java.lang.Thread.State: BLOCKED (on object monitor)
        at java.security.SecureRandom.nextBytes(SecureRandom.java:457)
        - waiting to lock <0x00000007a256cc20> (a java.security.SecureRandom)
        at sun.security.util.KeyUtil.checkTlsPreMasterSecretKey(KeyUtil.java:205)
        at com.sun.crypto.provider.RSACipher.engineUnwrap(RSACipher.java:459)
        at javax.crypto.Cipher.unwrap(Cipher.java:2506)
        at sun.security.ssl.RSAClientKeyExchange.<init>(RSAClientKeyExchange.java:120)
        at sun.security.ssl.ServerHandshaker.processMessage(ServerHandshaker.java:238)

        java.lang.Thread.State: RUNNABLE
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:255)
        at sun.security.provider.NativePRNG$RandomIO.readFully(NativePRNG.java:410)
        at sun.security.provider.NativePRNG$RandomIO.ensureBufferValid(NativePRNG.java:473)
        at sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:487)
        - locked <0x00000007a08a8ec0> (a java.lang.Object)
        at sun.security.provider.NativePRNG$RandomIO.access$400(NativePRNG.java:329)
        at sun.security.provider.NativePRNG.engineNextBytes(NativePRNG.java:218)
        at java.security.SecureRandom.nextBytes(SecureRandom.java:457)
        - locked <0x00000007a256cc20> (a java.security.SecureRandom)
        at sun.security.ssl.CipherBox.createExplicitNonce(CipherBox.java:1015)

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ascarpino Anthony Scarpino
                  Reporter:
                  ascarpino Anthony Scarpino
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: