JDK-8298865 : Excessive memory allocation in CipherOutputStream AEAD decryption
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-12-15
  • Updated: 2023-01-03
  • Resolved: 2022-12-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b03Fixed
Related Reports
Relates :  
Description
When CipherOutputStream is used to decrypt data compressed with AEAD cipher like AES/GCM, all data written to the stream is buffered until the stream is closed. 

During every write operation, a new buffer large enough to hold the entire decrypted data is allocated. If the writes are frequent, this puts GC under pressure.

This issue was noticed while investigating JDK-8298249, which reported a similar case with CipherInputStream.
Comments
Changeset: 36de61c4 Author: Daniel JeliƄski <djelinski@openjdk.org> Date: 2022-12-20 10:27:33 +0000 URL: https://git.openjdk.org/jdk/commit/36de61c460d7038019294293143e420dfcce2936
20-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11693 Date: 2022-12-15 14:05:43 +0000
15-12-2022