harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chunrong Lai (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory
Date Tue, 17 Feb 2009 10:30:59 GMT

    [ 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.

View raw message