harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Beliaev (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-3845) [drlvm][exception] Class unloading support in lazy stack creation.
Date Thu, 24 May 2007 16:00:56 GMT

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

Vladimir Beliaev updated HARMONY-3845:
--------------------------------------

    Attachment: test-plugin-unloading.zip

Here is the test which may be helpfull (test-plugin-unloading.zip).

It implements the general plugin-like scheme and:
  - create the PluginClassLoader (with finalizer defined)
  - load PluginSublcass (which extends PluginClass & has a finalizer defined)
  - instanciate it through Class.newInstance
  - cast to base class - PluginClass - and load 'init' method (which throws runtime exception)
  - store these exception, set classloader & plugin subclass objects to null
  - call to GC
  - etc...
Ok, it turned out that Bea JRockit keeps ClassLoader object until stored exception is kept.


And ... Hotspot does not unload ClassLoader at all in this test:

# jrockit
java -showversion TestExcCU
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized
over throughput (initial strategy singleparpar))
main: PluginClass is created...
PluginSubclass is being initialized...
main: PluginClass.init throwed exception...
main: plugin & classloader are set to NULL...
PluginSubclass is being unloaded...
main: GC is done...: storedException=java.lang.NullPointerException
java.lang.NullPointerException
        at PluginSubclass.init(PluginSubclass.java:5)
        at TestExcCU.main(TestExcCU.java:13)
PluginClassLoader is being unloaded...
main: GC is done...: storedException=null

# Hotspot
java -showversion TestExcCU
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
main: PluginClass is created...
PluginSubclass is being initialized...
main: PluginClass.init throwed exception...
main: plugin & classloader are set to NULL...
PluginSubclass is being unloaded...
main: GC is done...: storedException=java.lang.NullPointerException
java.lang.NullPointerException
        at PluginSubclass.init(PluginSubclass.java:5)
        at TestExcCU.main(TestExcCU.java:13)
main: GC is done...: storedException=null


> [drlvm][exception] Class unloading support in lazy stack creation.
> ------------------------------------------------------------------
>
>                 Key: HARMONY-3845
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3845
>             Project: Harmony
>          Issue Type: New Feature
>          Components: DRLVM
>            Reporter: Pavel Afremov
>         Attachments: 0001-First-version-of-class-unloading-support-implementat.patch,
0002-Tune-class-unloading-support-in-lazy-stack-creation.patch, ExceptionsBenchmark.java,
test-plugin-unloading.zip
>
>
> Class unloading support in lazy stack creation.
> When classes are unloaded, stack traces for all exception should be created, because
required information can be unreachable late. Static method "Throwable.createAllStackTraces()
"should be called for it.

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


Mime
View raw message