Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1232736 - [GSS](6.4.z) Memory leak in JBoss CLI
[GSS](6.4.z) Memory leak in JBoss CLI
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI (Show other bugs)
6.4.1
Unspecified Unspecified
high Severity high
: CR1
: EAP 6.4.3
Assigned To: Tomas Hofman
Petr Kremensky
: Reopened
Depends On:
Blocks: 1231259
  Show dependency treegraph
 
Reported: 2015-06-17 08:04 EDT by Josef Cacek
Modified: 2017-01-17 05:43 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-17 05:43:38 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-4798 Major Resolved Memory leak in JBoss CLI 2017-12-19 06:50 EST
Red Hat Knowledge Base (Solution) 1537083 None None None 2016-01-21 19:12 EST

  None (edit)
Description Josef Cacek 2015-06-17 08:04:42 EDT
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
Comment 2 Tomas Hofman 2015-07-08 05:32:20 EDT
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
Comment 4 Petr Kremensky 2015-07-30 07:22:37 EDT
Verified on EAP 6.4.3.CP.CR1
Comment 5 Petr Penicka 2017-01-17 05:40:49 EST
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.
Comment 6 Petr Penicka 2017-01-17 05:41:26 EST
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.
Comment 7 Petr Penicka 2017-01-17 05:43:38 EST
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Note You need to log in before you can comment on or make changes to this bug.