Bug 1232736
| Summary: | [GSS](6.4.z) Memory leak in JBoss CLI | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Josef Cacek <jcacek> |
| Component: | CLI | Assignee: | Tomas Hofman <thofman> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Petr Kremensky <pkremens> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.4.1 | CC: | bmaxwell, brian.stansberry, cdewolf, istudens, jboss-set, lkonno, thofman |
| Target Milestone: | CR1 | Keywords: | Reopened |
| Target Release: | EAP 6.4.3 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-01-17 10:43:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1231259 | ||
I modified CommandContextImpl so that JaasConfigurationWrapper is added only during first instance creation. That removes remaining references to CommandContextImpl instance, allowing it to be garbage collected. I also added demonstrational test case that could be used to verify the leak - note that it's @Ignored so that it doesn't run during build. PR: https://github.com/jbossas/jboss-eap/pull/2475 Verified on EAP 6.4.3.CP.CR1 Retroactively bulk-closing issues from released EAP 6.4 cummulative patches. Retroactively bulk-closing issues from released EAP 6.4 cumulative patches. Retroactively bulk-closing issues from released EAP 6.4 cumulative patches. |
Description of problem: The JBoss CLI contains a memory leak related to CLI Kerberos authentication. The org.jboss.as.cli.impl.CommandContextImpl class calls the initJaasConfig() in its constructor, which adds a new JaasConfigurationWrapper instance to javax.security.auth.login.Configuration. It's done for every new CommandContext instance, so it consumes more and more memory. There is no cleanup for the registered configurations. Moreover, the searches for appropriate login config take more and more time because they have to go through all the wrapped objects. How reproducible: always Steps to Reproduce: Simply create new `CommandContextImpl` instances. while (true) { CommandContextFactory.getInstance().newCommandContext(); } Actual results: OutOfMemory error (on my machine somewhere between 16k and 32k instances) Expected results: everything from unused CommandContexts is correctly cleaned up and new instances are created/disposed