harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivanov, Alexey A" <alexey.a.iva...@intel.com>
Subject RE: [classlib][swing][testing] Tests that depend on Garbage Collector
Date Thu, 07 Dec 2006 07:33:23 GMT
>-----Original Message-----
>From: Richard [mailto:richard.liangyx@gmail.com]
>Sent: Thursday, December 07, 2006 5:48 AM
>To: dev@harmony.apache.org
>Subject: Re: [classlib][swing][testing] Tests that depend on Garbage
>Collector
>
>Ivanov, Alexey A wrote:
>> Hi all,
>>
>> There are three tests in Swing which depend on Garbage Collector.
That is
>GC is _really_ run as the result of System.gc() call.
>>
>> These tests are:
>>     * javax.swing.text.GapContent_InternalTest.testPositionGC(),
>>     * javax.swing.text.StyleContextTest.testCollectGarbageInCache(),
and
>>     *
javax.swing.text.StyleContextTest.testCollectGarbageInCacheFont().
>>
>> What they check is:
>> * j.s.t.Position instances are removed from the internal list of
>GapContent when an instance is not used any more. (PhantomReference and
>WeakReference are involved.)
>> * cached AttributeSets are removed from it (WeakHashMap).
>> * cached Fonts are removed from the corresponding cache
(WeakReference).
>>
>>
>> These tests always pass when run on the RI. They were used to ensure
>caching works fine. None of VMs in Harmony seem to perform garbage
>collection when System.gc() is called, and mostly these tests fail.
However,
>sometimes they pass.
>>
>
>Alexey,
>
>According to the spec, "System.gc" only suggests JVM recycle unused
>objects, it does not guarantee that gc will be run.

Thank you, Richard.
I know this.

Regards,
Alexey.

>
>Best regards,
>Richard.
>
>>
>> How can we handle these tests? Just remove them?
>>
>> Thank you in advance,
>> --
>> Alexey A. Ivanov
>> Intel Enterprise Solutions Software Division
>>
>>
>
>
>--
>Richard Liang
>China Development Lab, IBM

--
Alexey A. Ivanov
Intel Enterprise Solutions Software Division

Mime
View raw message