Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomcat warn about leaked thread-locals #2

Open
mad opened this issue Jun 26, 2019 · 0 comments
Open

Tomcat warn about leaked thread-locals #2

mad opened this issue Jun 26, 2019 · 0 comments

Comments

@mad
Copy link

mad commented Jun 26, 2019

Tomcat check some vars for leaks when undeploy app and warn some info about opencypher

24-Jun-2019 16:53:12.027 SEVERE [https-jsse-nio-8443-exec-10] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Octopus2] created a ThreadLocal with key of type [org.opencypher.v9_0.util.Rewritable$$anon$1] (value [org.opencypher.v9_0.util.Rewritable$$anon$1@3d748832]) and a value of type [scala.collection.mutable.HashMap] (value [Map(class org.opencypher.v9_0.expressions.And -> public org.opencypher.v9_0.expressions.And org.opencypher.v9_0.expressions.And.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class scala.collection.immutable.$colon$colon -> public scala.collection.immutable.$colon$colon scala.collection.immutable.$colon$colon.copy(java.lang.Object,scala.collection.immutable.List), class org.opencypher.v9_0.expressions.Pattern -> public org.opencypher.v9_0.expressions.Pattern org.opencypher.v9_0.expressions.Pattern.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.SingleQuery -> public org.opencypher.v9_0.ast.SingleQuery org.opencypher.v9_0.ast.SingleQuery.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.RelationshipChain -> public org.opencypher.v9_0.expressions.RelationshipChain org.opencypher.v9_0.expressions.RelationshipChain.copy(org.opencypher.v9_0.expressions.PatternElement,org.opencypher.v9_0.expressions.RelationshipPattern,org.opencypher.v9_0.expressions.NodePattern,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Property -> public org.opencypher.v9_0.expressions.Property org.opencypher.v9_0.expressions.Property.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.PropertyKeyName,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Match -> public org.opencypher.v9_0.ast.Match org.opencypher.v9_0.ast.Match.copy(boolean,org.opencypher.v9_0.expressions.Pattern,scala.collection.Seq,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Where -> public org.opencypher.v9_0.ast.Where org.opencypher.v9_0.ast.Where.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Query -> public org.opencypher.v9_0.ast.Query org.opencypher.v9_0.ast.Query.copy(scala.Option,org.opencypher.v9_0.ast.QueryPart,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Ands -> public org.opencypher.v9_0.expressions.Ands org.opencypher.v9_0.expressions.Ands.copy(scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Not -> public org.opencypher.v9_0.expressions.Not org.opencypher.v9_0.expressions.Not.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.EveryPath -> public org.opencypher.v9_0.expressions.EveryPath org.opencypher.v9_0.expressions.EveryPath.copy(org.opencypher.v9_0.expressions.PatternElement), class scala.Some -> public scala.Some scala.Some.copy(java.lang.Object))]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
25-Jun-2019 12:58:36.291 SEVERE [http-nio-8080-exec-103] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Octopus2] created a ThreadLocal with key of type [org.opencypher.v9_0.util.Rewritable$$anon$1] (value [org.opencypher.v9_0.util.Rewritable$$anon$1@2e460cff]) and a value of type [scala.collection.mutable.HashMap] (value [Map(class org.opencypher.v9_0.expressions.EveryPath -> public org.opencypher.v9_0.expressions.EveryPath org.opencypher.v9_0.expressions.EveryPath.copy(org.opencypher.v9_0.expressions.PatternElement), class org.opencypher.v9_0.expressions.Ands -> public org.opencypher.v9_0.expressions.Ands org.opencypher.v9_0.expressions.Ands.copy(scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Or -> public org.opencypher.v9_0.expressions.Or org.opencypher.v9_0.expressions.Or.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class scala.Tuple2 -> public scala.Tuple2 scala.Tuple2.copy(java.lang.Object,java.lang.Object), class org.opencypher.v9_0.expressions.Pattern -> public org.opencypher.v9_0.expressions.Pattern org.opencypher.v9_0.expressions.Pattern.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Return -> public org.opencypher.v9_0.ast.Return org.opencypher.v9_0.ast.Return.copy(boolean,org.opencypher.v9_0.ast.ReturnItemsDef,scala.Option,scala.Option,scala.Option,scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.SingleQuery -> public org.opencypher.v9_0.ast.SingleQuery org.opencypher.v9_0.ast.SingleQuery.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.RelationshipChain -> public org.opencypher.v9_0.expressions.RelationshipChain org.opencypher.v9_0.expressions.RelationshipChain.copy(org.opencypher.v9_0.expressions.PatternElement,org.opencypher.v9_0.expressions.RelationshipPattern,org.opencypher.v9_0.expressions.NodePattern,org.opencypher.v9_0.util.InputPosition), class scala.Some -> public scala.Some scala.Some.copy(java.lang.Object), class org.opencypher.v9_0.ast.Match -> public org.opencypher.v9_0.ast.Match org.opencypher.v9_0.ast.Match.copy(boolean,org.opencypher.v9_0.expressions.Pattern,scala.collection.Seq,scala.Option,org.opencypher.v9_0.util.InputPosition), class scala.collection.immutable.$colon$colon -> public scala.collection.immutable.$colon$colon scala.collection.immutable.$colon$colon.copy(java.lang.Object,scala.collection.immutable.List), class org.opencypher.v9_0.ast.ReturnItems -> public org.opencypher.v9_0.ast.ReturnItems org.opencypher.v9_0.ast.ReturnItems.copy(boolean,scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.With -> public org.opencypher.v9_0.ast.With org.opencypher.v9_0.ast.With.copy(boolean,org.opencypher.v9_0.ast.ReturnItemsDef,scala.Option,scala.Option,scala.Option,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.CaseExpression -> public org.opencypher.v9_0.expressions.CaseExpression org.opencypher.v9_0.expressions.CaseExpression.copy(scala.Option,scala.collection.IndexedSeq,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.FunctionInvocation -> public org.opencypher.v9_0.expressions.FunctionInvocation org.opencypher.v9_0.expressions.FunctionInvocation.copy(org.opencypher.v9_0.expressions.Namespace,org.opencypher.v9_0.expressions.FunctionName,boolean,scala.collection.IndexedSeq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Query -> public org.opencypher.v9_0.ast.Query org.opencypher.v9_0.ast.Query.copy(scala.Option,org.opencypher.v9_0.ast.QueryPart,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.AliasedReturnItem -> public org.opencypher.v9_0.ast.AliasedReturnItem org.opencypher.v9_0.ast.AliasedReturnItem.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.LogicalVariable,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Where -> public org.opencypher.v9_0.ast.Where org.opencypher.v9_0.ast.Where.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Not -> public org.opencypher.v9_0.expressions.Not org.opencypher.v9_0.expressions.Not.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Property -> public org.opencypher.v9_0.expressions.Property org.opencypher.v9_0.expressions.Property.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.PropertyKeyName,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.And -> public org.opencypher.v9_0.expressions.And org.opencypher.v9_0.expressions.And.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition))]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Jun-2019 10:58:46.544 SEVERE [http-nio-8080-exec-16] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Octopus2] created a ThreadLocal with key of type [org.opencypher.v9_0.util.Rewritable$$anon$1] (value [org.opencypher.v9_0.util.Rewritable$$anon$1@522894e1]) and a value of type [scala.collection.mutable.HashMap] (value [Map(class org.opencypher.v9_0.ast.SingleQuery -> public org.opencypher.v9_0.ast.SingleQuery org.opencypher.v9_0.ast.SingleQuery.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Ands -> public org.opencypher.v9_0.expressions.Ands org.opencypher.v9_0.expressions.Ands.copy(scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.AliasedReturnItem -> public org.opencypher.v9_0.ast.AliasedReturnItem org.opencypher.v9_0.ast.AliasedReturnItem.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.LogicalVariable,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Not -> public org.opencypher.v9_0.expressions.Not org.opencypher.v9_0.expressions.Not.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.EveryPath -> public org.opencypher.v9_0.expressions.EveryPath org.opencypher.v9_0.expressions.EveryPath.copy(org.opencypher.v9_0.expressions.PatternElement), class org.opencypher.v9_0.ast.Where -> public org.opencypher.v9_0.ast.Where org.opencypher.v9_0.ast.Where.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.ReturnItems -> public org.opencypher.v9_0.ast.ReturnItems org.opencypher.v9_0.ast.ReturnItems.copy(boolean,scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class scala.collection.immutable.$colon$colon -> public scala.collection.immutable.$colon$colon scala.collection.immutable.$colon$colon.copy(java.lang.Object,scala.collection.immutable.List), class org.opencypher.v9_0.expressions.CaseExpression -> public org.opencypher.v9_0.expressions.CaseExpression org.opencypher.v9_0.expressions.CaseExpression.copy(scala.Option,scala.collection.IndexedSeq,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Property -> public org.opencypher.v9_0.expressions.Property org.opencypher.v9_0.expressions.Property.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.PropertyKeyName,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.FunctionInvocation -> public org.opencypher.v9_0.expressions.FunctionInvocation org.opencypher.v9_0.expressions.FunctionInvocation.copy(org.opencypher.v9_0.expressions.Namespace,org.opencypher.v9_0.expressions.FunctionName,boolean,scala.collection.IndexedSeq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Pattern -> public org.opencypher.v9_0.expressions.Pattern org.opencypher.v9_0.expressions.Pattern.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Match -> public org.opencypher.v9_0.ast.Match org.opencypher.v9_0.ast.Match.copy(boolean,org.opencypher.v9_0.expressions.Pattern,scala.collection.Seq,scala.Option,org.opencypher.v9_0.util.InputPosition), class scala.Tuple2 -> public scala.Tuple2 scala.Tuple2.copy(java.lang.Object,java.lang.Object), class org.opencypher.v9_0.ast.With -> public org.opencypher.v9_0.ast.With org.opencypher.v9_0.ast.With.copy(boolean,org.opencypher.v9_0.ast.ReturnItemsDef,scala.Option,scala.Option,scala.Option,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Return -> public org.opencypher.v9_0.ast.Return org.opencypher.v9_0.ast.Return.copy(boolean,org.opencypher.v9_0.ast.ReturnItemsDef,scala.Option,scala.Option,scala.Option,scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.RelationshipChain -> public org.opencypher.v9_0.expressions.RelationshipChain org.opencypher.v9_0.expressions.RelationshipChain.copy(org.opencypher.v9_0.expressions.PatternElement,org.opencypher.v9_0.expressions.RelationshipPattern,org.opencypher.v9_0.expressions.NodePattern,org.opencypher.v9_0.util.InputPosition), class scala.Some -> public scala.Some scala.Some.copy(java.lang.Object), class org.opencypher.v9_0.ast.Query -> public org.opencypher.v9_0.ast.Query org.opencypher.v9_0.ast.Query.copy(scala.Option,org.opencypher.v9_0.ast.QueryPart,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.And -> public org.opencypher.v9_0.expressions.And org.opencypher.v9_0.expressions.And.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition))]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Jun-2019 10:58:46.550 SEVERE [http-nio-8080-exec-16] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [Octopus2] created a ThreadLocal with key of type [org.opencypher.v9_0.util.Rewritable$$anon$1] (value [org.opencypher.v9_0.util.Rewritable$$anon$1@522894e1]) and a value of type [scala.collection.mutable.HashMap] (value [Map(class org.opencypher.v9_0.ast.SingleQuery -> public org.opencypher.v9_0.ast.SingleQuery org.opencypher.v9_0.ast.SingleQuery.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Ands -> public org.opencypher.v9_0.expressions.Ands org.opencypher.v9_0.expressions.Ands.copy(scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.AliasedReturnItem -> public org.opencypher.v9_0.ast.AliasedReturnItem org.opencypher.v9_0.ast.AliasedReturnItem.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.LogicalVariable,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Not -> public org.opencypher.v9_0.expressions.Not org.opencypher.v9_0.expressions.Not.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.EveryPath -> public org.opencypher.v9_0.expressions.EveryPath org.opencypher.v9_0.expressions.EveryPath.copy(org.opencypher.v9_0.expressions.PatternElement), class org.opencypher.v9_0.ast.Where -> public org.opencypher.v9_0.ast.Where org.opencypher.v9_0.ast.Where.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition), class scala.collection.immutable.$colon$colon -> public scala.collection.immutable.$colon$colon scala.collection.immutable.$colon$colon.copy(java.lang.Object,scala.collection.immutable.List), class org.opencypher.v9_0.ast.ReturnItems -> public org.opencypher.v9_0.ast.ReturnItems org.opencypher.v9_0.ast.ReturnItems.copy(boolean,scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.CaseExpression -> public org.opencypher.v9_0.expressions.CaseExpression org.opencypher.v9_0.expressions.CaseExpression.copy(scala.Option,scala.collection.IndexedSeq,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Property -> public org.opencypher.v9_0.expressions.Property org.opencypher.v9_0.expressions.Property.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.PropertyKeyName,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.FunctionInvocation -> public org.opencypher.v9_0.expressions.FunctionInvocation org.opencypher.v9_0.expressions.FunctionInvocation.copy(org.opencypher.v9_0.expressions.Namespace,org.opencypher.v9_0.expressions.FunctionName,boolean,scala.collection.IndexedSeq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.Pattern -> public org.opencypher.v9_0.expressions.Pattern org.opencypher.v9_0.expressions.Pattern.copy(scala.collection.Seq,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Match -> public org.opencypher.v9_0.ast.Match org.opencypher.v9_0.ast.Match.copy(boolean,org.opencypher.v9_0.expressions.Pattern,scala.collection.Seq,scala.Option,org.opencypher.v9_0.util.InputPosition), class scala.Tuple2 -> public scala.Tuple2 scala.Tuple2.copy(java.lang.Object,java.lang.Object), class org.opencypher.v9_0.ast.With -> public org.opencypher.v9_0.ast.With org.opencypher.v9_0.ast.With.copy(boolean,org.opencypher.v9_0.ast.ReturnItemsDef,scala.Option,scala.Option,scala.Option,scala.Option,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.ast.Return -> public org.opencypher.v9_0.ast.Return org.opencypher.v9_0.ast.Return.copy(boolean,org.opencypher.v9_0.ast.ReturnItemsDef,scala.Option,scala.Option,scala.Option,scala.collection.immutable.Set,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.RelationshipChain -> public org.opencypher.v9_0.expressions.RelationshipChain org.opencypher.v9_0.expressions.RelationshipChain.copy(org.opencypher.v9_0.expressions.PatternElement,org.opencypher.v9_0.expressions.RelationshipPattern,org.opencypher.v9_0.expressions.NodePattern,org.opencypher.v9_0.util.InputPosition), class scala.Some -> public scala.Some scala.Some.copy(java.lang.Object), class org.opencypher.v9_0.ast.Query -> public org.opencypher.v9_0.ast.Query org.opencypher.v9_0.ast.Query.copy(scala.Option,org.opencypher.v9_0.ast.QueryPart,org.opencypher.v9_0.util.InputPosition), class org.opencypher.v9_0.expressions.And -> public org.opencypher.v9_0.expressions.And org.opencypher.v9_0.expressions.And.copy(org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.expressions.Expression,org.opencypher.v9_0.util.InputPosition))]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Sample of code that works in application

CypherAst ast = CypherAst.parse(rewrittenCypher, normalizedParameters);

        Translator<String, GroovyPredicate> groovyTranslator =
            Translator.builder().gremlinGroovy()
                      .inlineParameters()
                      .enableCypherExtensions()
                      .enableMultipleLabels()
                      .build();

        String asGremlin = ast.buildTranslation(groovyTranslator);

        ReturnNormalizer returnNormalizer = ReturnNormalizer.create(ast.getReturnTypes());
        DefaultGraphTraversal g = new DefaultGraphTraversal(traversal.clone());
        Translator<GraphTraversal, P> translator =
            Translator.builder()
                      .traversal(g)
                      .enableCypherExtensions()
                      .enableMultipleLabels()
                      .build();

        try (Transaction tx = traversal.tx()) {
                final List<Result> collect = translatedTraversal.toStream()
                                                                .map(returnNormalizer::normalize)
                                                                .map(Result::new)
                                                                .collect(toList());
                tx.commit();
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant