You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2008/05/26 08:19:55 UTC

[jira] Created: (HARMONY-5844) [drlvm] class unloading wastes memory

[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


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.


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674223#action_12674223 ] 

Pavel Pervov commented on HARMONY-5844:
---------------------------------------

So, we can't process this dependency as the in-class-loader cycle during GC and can't unload class loader. Nice.

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674236#action_12674236 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


hi, Pavel:
      I think the dependency from the exception does not lead to the problem. It seems that we should not assume the exception as a live object (strong root).
      I found more should-be-unloaded classloaders who are not unloaded by drlvm, if they load classes with static object fields. It seems that the problems raise from all of static object fields enumeration, include but not limited to the previous-observed  NoClassDefFoundError. In this way an extended class registry is probably required. What is your opinion?

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@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.


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674258#action_12674258 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


hi, Pavel:
  See below example.

 Class A { //loaded by bootStrapLoader
   void testUnloading() {
     (new UserLoader()).LoadClass("B").newInstance().invoke("test");
     System.gc(); // Above loaded B is expected to be unloaded.
   }
 }

 Class B {
   void test() {
     B b = C.bField;
   }
 }
 
 Class C {
   static B bField = new B(); //bField is always live in drlvm which prevent the unloading
 }

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674090#action_12674090 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


    I investigated the issue and saw drlvm missed unloading some classes/classloaders in the tests.
    When loading/resolving error/exceptions happen, even it is the the expected behavior of the user application, drlvm records the exceptions with class_report_failure() as some static fields but never clear them. Because the exceptions are thus always live the related classes/classloaders are never unloaded. This leads to the observed "memory leaks".
    I am writing codes to clear the class_report_failure() but is considering the impact/requirement to class->lock()/unlock() in the added/existed cases. Your feedbacks/suggestions are welcome here.

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674220#action_12674220 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


 hi, Pavel:
       See HARMONY-3997 we have stackClass[] associated with an exception. In this way an exception connects to its stack frame as well as the methods/classes.  So I can observe that exception prevents the UserClassLoader be unloaded.
       I am seeking more test cases to see if we need to extend the class registry implementation to include the static object fields instead of simply treating them as string roots.

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602159#action_12602159 ] 

Alexey Varlamov commented on HARMONY-5844:
------------------------------------------

The lazy.StressTest indeed does many class loads and thus would consume more memory on each iteration (like any class unloading test have to) until class unloading is functioning properly (and more so if you turn it off). That is the point of test, exactly.
I've also seen "Cannot allocate pool storage" OOMs, these just confirm that native memory is leaking (so that new classloader on the next iteration cannot allocate native resources). 
In usual batch mode the test does only few iterations so has some chances to pass, while enhanced parameters increase number of iterations to ensure the test eats too much memory.

I did not quite get how did you observe a drop back in memory after passing the test - was it in the same live JVM incarnation? A special harness or launcher should be used I guess?

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674156#action_12674156 ] 

Pavel Pervov commented on HARMONY-5844:
---------------------------------------

Generally speaking, exceptions produced during loading should not be loaded by the class loader other than the class loader itself of delegation parent of this classloader. This way, exceptions recorded as loading failures must not be the only classes referenced from outside this class loader or they must belong to the class loader being unloaded.

The first case is class loading issue (which is very unlikely), and the second case is class unloading issue of GC being unable to correctly trace cyclic dependency inside single class loader (exception, recorded in the class entity, beloging to the class loader in question). It looks like missing case in DRLVM class unloading algorithm.

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


[jira] Assigned: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chunrong Lai reassigned HARMONY-5844:
-------------------------------------

    Assignee: Chunrong Lai

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601988#action_12601988 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


   Thanks. I could also observe OOM like "Cannot allocate pool storage: 00040000 bytes of virtual memory for code or data".
    My understanding is that the OOM probably comes from the test suite itself instead of from the class unloading. I did read the source code and see org.apache.harmony.vm.test.lazyresolution.StressTest 
is very memory consuming. At the same time one can turn off class unloading with option "-XX:gc.ignore_vtable_tracing=true" and still observe the memory increasing. I also see the memory consumption drops back to a normal number after the lazy.Stress.test passes (it can sometimes pass in batch-mode running but never pass in the standalone running with enhanced input parameters).
    Please let me know if I misunderstand the issue.

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674169#action_12674169 ] 

Pavel Pervov commented on HARMONY-5844:
---------------------------------------

Chunrong,

As NoClassDefFoundError is loaded by bootstrap class loader, it must not prevent UserClassLoader from being unloaded. If it does - we have serios problem in unloading algorithm.

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602145#action_12602145 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


  I also run this test suite with RI and I found the memory consumption basically kept the same value.
  The class loading process (instead of the unloading process) of Harmony is probably different with RI and needs improvement since I observed a same class is repeatedly loaded by different ClassLoader with Harmony which consumes the noticed memory.


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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Chunrong Lai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674222#action_12674222 ] 

Chunrong Lai commented on HARMONY-5844:
---------------------------------------


 Oops. String => strong.

 

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599766#action_12599766 ] 

Alexey Varlamov commented on HARMONY-5844:
------------------------------------------

Typical backtrace of OOM crash, just for reference:
Stack trace:
  0: memset (:-1)
  1: gc_alloc (c:\apache-dev\harmony\trunk\working_vm\vm\gc_gen\src\thread\mutator_alloc.cpp:94)
  2: vm_anewarray_resolved_array_type (c:\apache-dev\harmony\trunk\working_vm\vm\vmcore\src\object\vm_arrays.cpp:86)
  3: vm_new_vector (c:\apache-dev\harmony\trunk\working_vm\vm\vmcore\src\object\vm_arrays.cpp:157)
  4: vm_multianewarray_recursive (c:\apache-dev\harmony\trunk\working_vm\vm\vmcore\src\object\vm_arrays.cpp:317)
  5: vm_rt_multianewarray_recursive (c:\apache-dev\harmony\trunk\working_vm\vm\vmcore\src\jit\jit_runtime_support.cpp:89)
  6: rth_multianewarrayhelper (c:\apache-dev\harmony\trunk\working_vm\vm\vmcore\src\util\ia32\base\jit_runtime_support_ia32.cpp:679)
  7: stub::unknown
  8: org/apache/harmony/vm/test/lazyresolution/data/AllocationTest::testNewMultiArray6 (()V): AllocationTest.java:258

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


[jira] Commented: (HARMONY-5844) [drlvm] class unloading wastes memory

Posted by "Pavel Pervov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674241#action_12674241 ] 

Pavel Pervov commented on HARMONY-5844:
---------------------------------------

I see the only possibility how static fields can prevent class unloading - if they point to the objects of classes loaded by the same class loader as containing class. I made some drawings on my table and I can't see how it is preventing unloading...

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