hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yang Jiandan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-8605) TestReflectionUtils.testCacheDoesntLeak() can't illustrate ReflectionUtils don't generate memory leak
Date Wed, 18 Jul 2012 03:53:33 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-8605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Yang Jiandan updated HADOOP-8605:
---------------------------------

    Description: 
TestReflectionUtils.testCacheDoesntLeak() uses different urlClassLoader to load TestReflectionUtils$LoadedInChild
in a for cycle:
{code}
    int iterations=9999;
    for (int i=0; i<iterations; i++) {

      URLClassLoader loader = new URLClassLoader(new URL[0], getClass().getClassLoader());

      Class cl = Class.forName("org.apache.hadoop.util.TestReflectionUtils$LoadedInChild",
false, loader);

      Object o = ReflectionUtils.newInstance(cl, null);

      assertEquals(cl, o.getClass());

    }
{code}
but every time it generate the same class,so in ReflectionUtils.CONSTRUCTOR_CACHE only include
one class.


  was:
TestReflectionUtils.testCacheDoesntLeak() uses different urlClassLoader to load TestReflectionUtils$LoadedInChild
in a for cycle:
{code}
    int iterations=9999;
    for (int i=0; i<iterations; i++) {

      URLClassLoader loader = new URLClassLoader(new URL[0], getClass().getClassLoader());

      Class cl = Class.forName("org.apache.hadoop.util.TestReflectionUtils$LoadedInChild",
false, loader);

      Object o = ReflectionUtils.newInstance(cl, null);

      assertEquals(cl, o.getClass());

    }
{code}
but every time it generate the same class


    
> TestReflectionUtils.testCacheDoesntLeak() can't illustrate ReflectionUtils don't generate
memory leak
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-8605
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8605
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 1.0.3
>            Reporter: Yang Jiandan
>
> TestReflectionUtils.testCacheDoesntLeak() uses different urlClassLoader to load TestReflectionUtils$LoadedInChild
in a for cycle:
> {code}
>     int iterations=9999;
>     for (int i=0; i<iterations; i++) {
>       URLClassLoader loader = new URLClassLoader(new URL[0], getClass().getClassLoader());
>       Class cl = Class.forName("org.apache.hadoop.util.TestReflectionUtils$LoadedInChild",
false, loader);
>       Object o = ReflectionUtils.newInstance(cl, null);
>       assertEquals(cl, o.getClass());
>     }
> {code}
> but every time it generate the same class,so in ReflectionUtils.CONSTRUCTOR_CACHE only
include one class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message