Odd memory leak
Cantor, Scott
cantor.2 at osu.edu
Thu Nov 17 19:32:54 EST 2016
> After spending a couple of days setting up jmeter scripts and digging
> through heaps, I finally figured out what is going on. We are using
> the JAAS module and then have custom code in place to authenticate to a
> local database. In 2.4 that worked fine. In 3.2 it seems that for
> every login attempt the IDP calls the initialize() method of the
> LoginModule.
The IdP doesn't call that in either version but definitely not in 3. We just instantiate a JAAS configuration and call login() on it. The rest is under the covers and managed by Java. It's abstracted away from individual modules and the IdP has nothing to do with their lifetime. I suspect if you configured V3 to use a system-level JAAS config instead of an explicit one, that might end up behaving more like it did before.
> Our code was constantly creating new connection pools
> ever time you logged in. Those pools were getting attached to Thread
> pools that were long lived. So, the longer the IDP was up, the more
> connection pools we would generate. Eventually we would have 20,000 or
> more of them active and the IDP would run out of memory. For some
> reason that wasn't occurring with 2.4.
I think your code was assuming some kind of lifecycle behavior that is not part of the JAAS interface, but that assumption was not valid and the IdP is not really required to behave in any particular way. V2 and V3 are nothing alike. But those differences should not impact a correctly written JAAS module. I think you just identified that yours wasn't, but that seems to be the conclusion you reached, so I'm not telling you anything new.
-- Scott
More information about the dev
mailing list