You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Darrel Schneider (JIRA)" <ji...@apache.org> on 2018/10/05 19:27:00 UTC

[jira] [Resolved] (GEODE-5783) geode should use a single class to create instances of ThreadFactory

     [ https://issues.apache.org/jira/browse/GEODE-5783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Darrel Schneider resolved GEODE-5783.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.8.0

https://github.com/apache/geode/pull/2535

> geode should use a single class to create instances of ThreadFactory
> --------------------------------------------------------------------
>
>                 Key: GEODE-5783
>                 URL: https://issues.apache.org/jira/browse/GEODE-5783
>             Project: Geode
>          Issue Type: Improvement
>          Components: core
>            Reporter: Darrel Schneider
>            Assignee: Darrel Schneider
>            Priority: Major
>             Fix For: 1.8.0
>
>
> Geode creates a large number of ThreadFactory instances. Most of these are created with anonymous inner classes. In most cases the ThreadFactory instance is passed on to a thread pool. Since thread pools are finalizable they will keep alive anything they reference until finalization takes place. Most JVM garbage collectors delay doing finalization as long as possible. Since an anonymous inner class always has a references to the outer class instance, a number of places will end up having a reference to our single GemFireCacheImpl which can end up preventing a large amount of heap from being garbage collected.
> For the above reasons, and also to avoid code duplication, it would be better if we had a single utility class that took care of creating ThreadFactory instances. We already have one such class in geode named GemFireCacheHelper that is only used from one class. Also google guava has ThreadFactoryBuilder which could be used.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)