Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C5F542004C8 for ; Mon, 9 May 2016 10:11:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C4A2816098A; Mon, 9 May 2016 08:11:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1BB501601D4 for ; Mon, 9 May 2016 10:11:09 +0200 (CEST) Received: (qmail 61472 invoked by uid 500); 9 May 2016 08:11:04 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 61461 invoked by uid 99); 9 May 2016 08:11:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2016 08:11:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4B2DBC0A00 for ; Mon, 9 May 2016 08:11:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Zg5A9i83WZ0J for ; Mon, 9 May 2016 08:11:02 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 71F535FE5F for ; Mon, 9 May 2016 08:11:01 +0000 (UTC) Received: from [192.168.1.8] ([92.224.3.94]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M5r89-1boeIx47Bp-00xt5E for ; Mon, 09 May 2016 10:10:55 +0200 Subject: Re: To ClassValue or not to ClassValue: That is the question! To: dev@groovy.apache.org References: <572ECD0B.1070808@span.ch> From: Jochen Theodorou Message-ID: <5730460C.608@gmx.org> Date: Mon, 9 May 2016 10:10:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <572ECD0B.1070808@span.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:/Iz42utFVHl/C2qBEjQb4WtkXNF4Aa5cTSLXzeD8t9zA9BXrQFY ZqfMAdffuygmfedKu6LoWQIpW/WUdzK+/s1QwDQGosYUnmXOufR7U3gJMW2sUNJJUsMxLEy rbBKg1xx/zPlvhiL49xHdP3+sDjVUZ75rz4Ik27J0YZs/vCa90QQ2DS8pFohceD629wGUAP GZT6Ndce+4WMOqV3LuVJQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:6kO4q8sG0t8=:dGLbqQJPrzpDybQcd78YC+ JMPhKQM5ZEV1nhsDID7AG5D7VJyR5l2spSjgp1XdHM391ajMKZH5hAXVaEiu89nG714IcnNyX SKm2gCRqv1R6jAk4vfgL0NKQSOzGSMW5I10VQbh2bA9oeglaJv8kHU/D+dZ3JeclIjjItWsGc 6N5ogs+wRMkPHCXGYVIFNLN6adkUkVXw74lrPdogbiuFIMryOwd3noYu6gSPJgjU80IHiaDp4 Q/7UbinYH3Vpv4yjKy1kXCyC+BP3GS9NAChZnTYJTCTxV/t14TjbkuA42At2lIsGX2YcDa2nt RR7kPQdG76sSqwBDdOKLC1ivtxwKHVfZHDRX9trabN55MoEtHGS0gJkysPD0SOmKoYC1kA4r9 JMTZjahRmbVu0or4h2ku8OBJpSUKqDOLL1GSnPIt60ODK0tE1vEApIlYIz14sz2OyHqzdW/d0 Dtors5oaU1sfQ54WKJPLcN4P9z+GbFlA2UU7uHc3lDQltgbj/xTXy6TTYcUXGqjPpRO4GNFHM 8oAAhyaM7XsJf8iia2DXgT+qKicvAz49f78GNI7VDVEbUGj4pqtWTQWRLAigP9YKqoFd10Jft Sxi26Z0zqXGce+vUJdPUn7QAMQkDBhIAJioyq1KzRAy2K7fR4Kx9CV/unpsHEArVKbPlGCdGj yoycJBj7b1e2//Cge7SzpbMepfyLYWm15VhLkoSPTyoCdNXNmnmmF7hVBbl5AthBM/7exeRgG vB+ip5fUmjafUA5u+7+HWg/3Q7zK5F0bpZUDG8sgTN/s+Rq+MfFrAeNBo4svqQWwcXlCfdlJf DyCIzfv archived-at: Mon, 09 May 2016 08:11:11 -0000 On 08.05.2016 07:22, Alain Stalder wrote: > GROOVY-7591 "Use of ClassValue causes major memory leak", > https://issues.apache.org/jira/browse/GROOVY-7591 > > introduced a new System Property groovy.use.shareclasses in > Groovy 2.4.5 and 2.4.6 which is "false" by default. > > But this also caused follow-up issues with garbage collection > of "Groovy" classes, which go away if setting > groovy.use.shareclasses=true, which was also my experience. > > GROOVY-7683 Memory leak when using Groovy as JSR-223 scripting language > GROOVY-7646 Classes generated by Eval() never collected from > Permgen/Metaspace I think 2.4.7 will have an improved version here, that fixes the memory problems for ClassValue and for not ClassValue. Because both versions are supposed to be working, unless you fall over a JVM bug. > "Not to ClassValue" (default): > > Don't do this if you parse many Groovy scripts or only load > many classes compiled from Groovy scripts - this will fill up > PermGen/Metaspace and blow up with an "OutOfMemoryError" and > you will see lots of MetaMethodIndex$Entry in heap dumps. (Right?) > > "To ClassValue": > > Personally, I have not observed any issues with this setting, > with Groovy 2.4.6 - under which circumstances would I have a > leak with groovy.use.shareclasses=true? > > Can this be explained in a few sentences? > > There has been some very recent conversation at GROOVY-7683 by > John Wagenleitner and Jochen Theodorou, so maybe there is a fix > for an upcoming version in preparation? what did happen was, that the implementation for ClassValue caused some refactorings on the old code, which produced a difficult to diagnose memory leak in the old code, as well as the new code not always working. The problem is that the code for ClassValue itself is still in flux.. just last week there had been for example discussions about replacing the whole map used in ClassValue... with like 4 different versions to choose from. Anyway... as there are still things in flux we got an implementation that worked sometimes and under certain circumstances, but not always. But I am positive those problems are fixed then in 2.4.7... it is also not that all Groovy versions are hit by this problem. Any version before the ClassValue change for example is unaffected. A general use classvalue or not, cannot be adviced really... it depends on the version. > Any news on that which could already be communicated here? I think we should work on getting a proper 2.4.7 out and then communicate that people should upgrade bye Jochen