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

Reduce GC pressure during message digest calculations in password-based encryption

    Details

      Backports

        Description

        In PBES1Core.deriveCipherKey() there are loops that look like following:

                    for (int i = 0; i < iCount; i++) {
                        md.update(toBeHashed);
                        toBeHashed = md.digest(); // this resets the digest
                    }
        Calling md.digest() each time allocates a new byte[] array.
        It would be more GC friendly, if the same array were reused.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  igerasim Ivan Gerasimov
                  Reporter:
                  igerasim Ivan Gerasimov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: