You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Aleksey Ignatenko (JIRA)" <ji...@apache.org> on 2007/03/21 13:47:32 UTC

[jira] Created: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

[dlrvm] new j.l.Class tracing model
-----------------------------------

                 Key: HARMONY-3462
                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
             Project: Harmony
          Issue Type: Improvement
          Components: DRLVM
            Reporter: Aleksey Ignatenko
         Attachments: new_class_registry_v7.patch

The jira introduces new model of j.l.Class referencing into drlvm.

The current model is:
all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.

The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 

The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497832 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

Checked new_class_registry_v8.patch on IA32 Lnx/Win and EM64t Lnx both with gc_gen and gc_cc. Passed "build test" and EHWA (manually). No issues found on tests run.

Used version:
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r540412, (May 22 2007), Windows/ia32/msvc 1310, debug build
http://incubator.apache.org/harmony

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492458 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

The patch is not for commit untill GCv5 fully supports gc_add_weak_root_set_entry functionality.
Plus I consider the patch is to be tested with more test suits than those in precommit criterion.
Plus the performance measurements are to be done.

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

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

Aleksey Ignatenko updated HARMONY-3462:
---------------------------------------

    Attachment: new_class_registry_v7.patch

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498274 ] 

Gregory Shimansky commented on HARMONY-3462:
--------------------------------------------

Alexey, sorry but I had to revert your changes at 540977. They break VM so that it doesn't start, it fails on assertion. The patch should get more testing before it is committed.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482743 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

passed smoke tests on win/lnx IA32

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

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

Pavel Pervov commented on HARMONY-3462:
---------------------------------------

As reported classes are now used as temporary storage for enumerating not yet loaded classes, should this collection be renamed?

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Alexey Varlamov commented on HARMONY-3462:
------------------------------------------

Gregory, no problem - I've tested on release build so might miss an assertion. Will look closer.
Other issues came to my mind over night:
1) asymmetric linking between classes and defining loader, so that array classes may have no link to the loader - must be fixed.
2) Initiated classes are not linked and even not enumerated - is it by spec? 

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

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

Aleksey Ignatenko updated HARMONY-3462:
---------------------------------------

    Attachment: new_class_registry_v8.patch

Updated patch new_class_registry_v8.patch.
Fixed comments.

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Alexey Varlamov commented on HARMONY-3462:
------------------------------------------

I fixed the mentioned issues at r540942. please verify.

BTW, what for ClassLoader.loadedClasses is declared Map - is some lookup intended later? Otherwise plain ArrayList<Class>  would work with lesser overhead...

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

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

Aleksey Ignatenko updated HARMONY-3462:
---------------------------------------

    Patch Info:   (was: [Patch Available])

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Alexey Varlamov commented on HARMONY-3462:
------------------------------------------

Pavel, this is what I added in H3462-postfix.diff
Note "static" qualifier for jmethodID, so it is initialized only once.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: H3462-postfix.diff, new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498489 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

to Chunrong Lai:
>I tested the patch but did not see classes are unloaded. 
> I also see the j.l.Classes are reachable (marked) from j.l.Classloader via the field loadedClasses. 
> Maybe you can show me an overall picture about class unloading and some test cases? I need them to understand what to implement in GC 
> (include the weak roots support of course) to unloaded the classes. 

I will answer you with separate letter as it is rather lot of info.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498119 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

Alexey, thanks for the notes, all comments are valid, please proceed with your patch.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490816 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

I'm going to fix commented and prepare new patch this week.

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Gregory Shimansky resolved HARMONY-3462.
----------------------------------------

    Resolution: Fixed

Patch applied at 540704. Please check that it was applied as expected.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Gregory Shimansky reassigned HARMONY-3462:
------------------------------------------

    Assignee: Gregory Shimansky

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482747 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

Checked with GCv4.1 and GCv5.

Importent! - GCv5 specifics:
GCv5 does not implement gc_add_weak_root_set_entry function (used in vm_enumerate_weak_root_reference). Therefore enumeration as weak reference is not available.
For the first sight it is not to be able to work with GCv5, But drlvm redirects gc_add_weak_root_set_entry fucntion to default one which is gc_add_root_set_entry (as a result j.l.Classes are always reachable - added to rootset as strong references + traced by GC via j.l.Classloader), therefore GCv5 works fine with the patch, but class unloading is not implementable on it untill it supports gc_add_weak_root_set_entry function.


> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Gregory Shimansky updated HARMONY-3462:
---------------------------------------

    Summary: [dlrvm][classloader][unloading] new j.l.Class tracing model  (was: [dlrvm] new j.l.Class tracing model)

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Pavel Pervov commented on HARMONY-3462:
---------------------------------------

Could we preload and cache "java/lang/ClassLoader" in Global_Env instead of looking it up every class loading?

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: H3462-postfix.diff, new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Alexey Varlamov updated HARMONY-3462:
-------------------------------------

    Attachment: H3462-postfix.diff

More complete fix is attached, please review & commit.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: H3462-postfix.diff, new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498461 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

> BTW, what for ClassLoader.loadedClasses is declared Map - is some lookup intended later? Otherwise plain ArrayList<Class> would work with lesser overhead... 

Alexey, the initial idea of using Map was to find loaded class by name w/o entering native VM code. But this is not related to the current JIRA therefor I would say Map can be changed to ArrayList w/o any problems. 



> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Alexey Varlamov closed HARMONY-3462.
------------------------------------


I've integrated enhanced postfix patch at revision: 543106, fixed all issues + optimized Class.getClassLoader() method - as the loader is liked via instance field, no need to request api2vm any more (-1 JNI call).


> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>            Assignee: Gregory Shimansky
>         Attachments: H3462-postfix.diff, new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Alexey Varlamov commented on HARMONY-3462:
------------------------------------------

I see the following issues: 

in j.l.ClassLoader mods:
+ public void addToLoadedClasses(String name, Class clazz) {
+ synchronized (loadedClasses){
+ loadedClasses.put(name, clazz); 
+ }
+ }

1) The method must not be public, only private or package-private.
2) Superfluous synchronization: either declare loadedClasses as HashMap or drop synchronized block from this method.

In j.l.Class:
+ protected ClassLoader definingLoader;
Must be package-private

In root_set_enum_common.cpp, function static void check_ref(void** ref) better place under #if _DEBUG (to avoid compiler remarks etc).
.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

Posted by "Aleksey Ignatenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493329 ] 

Aleksey Ignatenko commented on HARMONY-3462:
--------------------------------------------

Passed smoke.tests on Win IA32 with new_class_registry_v8.patch.

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Chunrong Lai commented on HARMONY-3462:
---------------------------------------


 I tested the patch but did not see classes are unloaded.
 I also see the j.l.Classes are reachable (marked) from j.l.Classloader via the field loadedClasses.
 Maybe you can show me an overall picture about class unloading and some test cases? I need them to understand what to implement in GC (include the weak roots support of course) to unloaded the classes.
 Thank you very much.

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Assigned To: Gregory Shimansky
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-3462) [dlrvm] new j.l.Class tracing model

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

Pavel Pervov commented on HARMONY-3462:
---------------------------------------

You do not consider throwing OutOfMemoryError from invocation of ClassLoader.addToLoadedClasses

> [dlrvm] new j.l.Class tracing model
> -----------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3462) [dlrvm][classloader][unloading] new j.l.Class tracing model

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

Aleksey Ignatenko updated HARMONY-3462:
---------------------------------------

    Patch Info: [Patch Available]

> [dlrvm][classloader][unloading] new j.l.Class tracing model
> -----------------------------------------------------------
>
>                 Key: HARMONY-3462
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3462
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Aleksey Ignatenko
>         Attachments: new_class_registry_v7.patch, new_class_registry_v8.patch
>
>
> The jira introduces new model of j.l.Class referencing into drlvm.
> The current model is:
> all j.l.Classes (JLC) and j.l.Classloaders (JLCL) are enumerated as strong references inside drlvm. It means that all JLC and JLCL are always reachable and we can not track any referencing between classes and classloaders automatically by GC.
> The new model is required by clas unloading (independent of class unloading design). Lets name term "class registry" as -  JLCL refers to its JLC and JLC refer to their defining JLCL (phisically via valid references). This requirement comes from the statement that classloader and all classes loaded by it are to be unloaded at once. e.g. Robin-Salikh approach requires that only JLCL are enumerated then JLC are to be traced automatically by GC (via references in appropriate JLCL - right now there is no direct reference to JLC in JLCL and vice versa). 
> The patch new_class_registry_v7.patch introduces the direct references described above. Also, it changes enumeration model: from now all JLC are traced via JLCL. JLC references are enumerated as weak references now (to be updated by GC).
> Also destination of m_loadedClasses and m_reportedClasses has changed. For now m_loadedClasses is responsible for weak enumeration of all loaded UserDefined j.l.Classes and m_reportedClasses is responsible for enumeration of all bootstrap classes and userdefined classes (untill they are added to class registry)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.