Bug 1232736 - [GSS](6.4.z) Memory leak in JBoss CLI
Summary: [GSS](6.4.z) Memory leak in JBoss CLI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI
Version: 6.4.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: CR1
: EAP 6.4.3
Assignee: Tomas Hofman
QA Contact: Petr Kremensky
URL:
Whiteboard:
Depends On:
Blocks: 1231259
TreeView+ depends on / blocked
 
Reported: 2015-06-17 12:04 UTC by Josef Cacek
Modified: 2019-09-12 08:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 10:43:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-4798 0 Major Resolved Memory leak in JBoss CLI 2017-12-19 11:50:40 UTC
Red Hat Knowledge Base (Solution) 1537083 0 None None None 2016-01-22 00:12:11 UTC

Description Josef Cacek 2015-06-17 12:04:42 UTC
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 09:32:20 UTC
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 11:22:37 UTC
Verified on EAP 6.4.3.CP.CR1

Comment 5 Petr Penicka 2017-01-17 10:40:49 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.

Comment 6 Petr Penicka 2017-01-17 10:41:26 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 7 Petr Penicka 2017-01-17 10:43:38 UTC
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.