Java heap retention in JceSecurity's static verificationResults map
Environment
- Java
- JBoss Enterprise Application Platform (EAP)
Issue
- We see a growing amount of heap usage in javax.crypto.JceSecurity's static verificationResults map:
Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------------------------
class javax.crypto.JceSecurity @ 0x6c3084340 System Class, Busy Monitor| 139,504 | 40 | 13,392,384 | 3,326,758,208
'- verificationResults java.util.IdentityHashMap @ 0x6c308b620 | 139,504 | 40 | 13,392,384 | 3,326,756,536
-----------------------------------------------------------------------------------------------------------------------------------------
Resolution
- Create the JCE provider once and cache it in the application for reuse instead of recreating the provider repeatedly.
Root Cause
- JCE providers are being created repeatedly over time
- Content from bugs.openjdk.java.net is not included.JDK-8168469
Diagnostic Steps
- Obtain a heap dump from the time of the issue as described in How do I create a Java heap dump?
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.