From commits-return-57284-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Tue Feb 17 10:31:23 2009 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 17841 invoked from network); 17 Feb 2009 10:31:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Feb 2009 10:31:23 -0000 Received: (qmail 56134 invoked by uid 500); 17 Feb 2009 10:31:23 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 56042 invoked by uid 500); 17 Feb 2009 10:31:23 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 56022 invoked by uid 99); 17 Feb 2009 10:31:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2009 02:31:22 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2009 10:31:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A179E234C495 for ; Tue, 17 Feb 2009 02:30:59 -0800 (PST) Message-ID: <661731088.1234866659659.JavaMail.jira@brutus> Date: Tue, 17 Feb 2009 02:30:59 -0800 (PST) From: "Chunrong Lai (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory In-Reply-To: <1804947356.1211782795653.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674168#action_12674168 ] Chunrong Lai commented on HARMONY-5844: --------------------------------------- hi, Pavel: Thanks for the discussion. The exception itself does not belong to (is not loaded) the class loader being unloaded. I am not sure if I understand your case1. Let us say A (loaded by UserClassLoader) meets an error when loading B (loaded by UserClassLoader), a NoClassDefFoundError (loaded by SystemLoader) will be recorded, just like a static object field of A. Because we treat such exceptions as strong roots (just like the static fields in vm_enumerate_class_static) currently, the exception is marked as live, A and the UserClassLoader will be marked as live after GC's tracing. With my previous modification of clearing the recorded exceptions (after they are consumed) A and the classloader can be just dead. Your description of cyclic dependency makes me think that I could treat them not as strong roots. Instead I need to update the class registry (among the classloader and the loaded classes) to include the exceptions (and the object fields) with the classes. This way the classes will be also dead. Is it what you suggested? > [drlvm] class unloading wastes memory > ------------------------------------- > > Key: HARMONY-5844 > URL: https://issues.apache.org/jira/browse/HARMONY-5844 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Alexey Varlamov > Assignee: Chunrong Lai > > Simple class unloading scenario shows that DRLVM leaks memory (and finally crashes). To reproduce, run StressTest of lazy.test suite and watch that process gradually consumes more and more memory. If compared to RI, the last keeps memory flat during very long runs. > Memory leaks roughly in the same rate for any execution mode, compiled or interpreted. > For convenience, there is standalone launcher org.apache.harmony.vm.test.lazyresolution.StressTest which can vary stress load, e.g.: > working_vm$ cd build\windows_x86_msvc_release\tests\lazy.tests\classes > classes$ java -cp .;junit.jar -Dlazy.test.iterations=100 -Dlazy.test.threads=10 org.apache.harmony.vm.test.lazyresolution.StressTest -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.