Menu

#465 Memory leak when using any class that NPSystem

Connection
open
nobody
None
5
2022-07-20
2022-07-20
No

For example when calling com.ibm.as400.access.OutputQueue.hold(), the AS400 system that is passed in will be placed into the map com.ibm.as400.access.NPSystem.NPSystemTable_. This is placed in as a hard reference, and so will never be freed. This can be ameliorated to some exten by using com.ibm.as400.access.AS400ConnectionPool, however if you use a lot of users, or a lot of systems, then the map in NPSystem still won't be cleaned, even once the AS400 entries have been cleared from the connection pool.

The map in NPSystem should probably hold be a weak reference to the AS400 that it is using, given that this is using object equality for the key, it doesn't make sense to hold onto objects if nothing else is holding onto the AS400 object.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB