You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Pavel Pervov (JIRA)" <ji...@apache.org> on 2009/02/09 08:28:59 UTC
[jira] Commented: (HARMONY-6084) [eut][drlvm][classunloading]
classunloading test of EUT35 fails with drlvm
[ https://issues.apache.org/jira/browse/HARMONY-6084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671752#action_12671752 ]
Pavel Pervov commented on HARMONY-6084:
---------------------------------------
I support option (2) too. It can be possible to count the number of calls to gc_force_gc and enforce major gc each N-th call to gc_force_gc.
> [eut][drlvm][classunloading] classunloading test of EUT35 fails with drlvm
> --------------------------------------------------------------------------
>
> Key: HARMONY-6084
> URL: https://issues.apache.org/jira/browse/HARMONY-6084
> Project: Harmony
> Issue Type: Bug
> Components: DRLVM
> Affects Versions: 5.0M8
> Environment: All
> Reporter: Chunrong Lai
>
> In org.eclipse.ui.tests of EUT, some classunloading errors like "testClass() for ..." are found.
> I see EUT just invokes GC 100 times after a class has been useless to guarantee the class is unloaded.
> On the other hand, Drlvm just does class unloading in its "major GC". So a class can be just not unloaded when running EUT. But forcing every GC as major GC will pass the related EUT tests.
> The error is not difficult to be fixed by one of below approaches:
> (1) Change the classunloading mechanism of drlvm to let it happens in every GC.
> (2) Change the gc_force_gc implementation to give a certain priority to "major GC".
> (3) Claim the test case as invalid because the SPEC does not guarantee a class is unloaded.
> I prefered (2), suggestions?
> Some EUT sources are also listed for reference:
> public void testClass() throws Exception {
> setName("testClass() for " + getClass().getName());
> Bundle bundle = getBundle();
> Class clazz = bundle.loadClass(className);
> assertNotNull(clazz);
> ReferenceQueue myQueue = new ReferenceQueue();
> WeakReference ref = new WeakReference(clazz.getClassLoader(), myQueue);
> clazz = null; //null our refs
> bundle = null;
> removeBundle();
> checkRef(myQueue, ref);
> }
>
> public static void checkRef(ReferenceQueue queue, Reference ref)
> throws IllegalArgumentException, InterruptedException {
> boolean flag = false;
> for (int i = 0; i < 100; i++) {
> System.runFinalization();
> System.gc();
> Thread.yield();
> processEvents();
> Reference checkRef = queue.remove(100);
> if (checkRef != null && checkRef.equals(ref)) {
> flag = true;
> break;
> }
> }
> assertTrue("Reference not enqueued", flag);
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.