Xiao-Feng Li wrote:
Gregory, there are a couple of native resources in VM that have Java
objects associated, such as fat lock, classes, etc. They can have
different solutions based on their characteristics. I need think more
on the tagged object GC support.
The difference with special VM objects that have native resources is
that special objects have some references to the data associated with
them. When JVMTI agent tags objects, this data has to be stored
somewhere else.
If we change the current implementation I think it is good to note that
in Java 6 Sun has changed [1] heap iteration API significantly. There
are many small additions like filtering objects based on the tagged
object class object.
[1] http://java.sun.com/javase/6/docs/technotes/guides/jvmti/changes6.html
On 7/24/07, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
Xiao-Feng Li wrote:
> On 7/23/07, Alexei Fedotov <[EMAIL PROTECTED]> wrote:
>> Folks,
>>
>> > These object references are enumerated as weak
>>
>> There might be a coincidence with the message Harmony VM continues to
>> print:
>> The GC did not provide gc_add_weak_root_set_entry()
>>
>> When we just got GC v4 before Salikh implemented weak roots they
>> counted as strong ones and were not collectable. Xiaofeng, does it
>> make sense?
>
> We need discuss if this makes sense to use weak root for tagged
> objects, or whether we have better solutions.
It seems to be a convenient way to keep a reference to an object that
wouldn't keep it from being collected, so it does make sense to me.
Other solution would be to allocate tags inside of objects themself
inside of heap, but there is a big problem with it because spec states
that tags are local to JVMTI environment. If an agent creates many
environments, or if there is more than JVMTI agent, it may be necessary
to associate different environments with the same object.
>> On 7/23/07, Gregory Shimansky <[EMAIL PROTECTED]> wrote:
>> > Xiao-Feng Li wrote:
>> > > Eugene, what are tagged objects? are they non-reachable objects?
>> >
>> > Tags are JVMTI attributes that may be assigned to an object using
>> > SetTag() JVMTI function. These attributes may be used by heap
profiler
>> > to analyze it. Tagged objects may be reachable or not, those that
>> aren't
>> > reachable should be collected by GC. Take a look at JVMTI spec
section
>> > that describes heap iteration API [2].
>> >
>> > In JVMTI code tags to objects are implemented as a pair of jlong and
>> > object reference. These object references are enumerated as weak
(see
>> > file jvmti_tags.cpp) using gc_add_weak_root_set_entry() so GC should
>> not
>> > have a problem removing unreachable objects.
>> >
>> > [1]
http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#SetTag
>> > [2] http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#Heap
>> >
>> > > On 7/21/07, Eugene S. Ostrovsky (JIRA) <[EMAIL PROTECTED]> wrote:
>> > >> [drlvm][jvmti][gc] GC_gen doesn't collect tagged objects
>> > >> --------------------------------------------------------
>> > >>
>> > >> Key: HARMONY-4511
>> > >> URL:
>> https://issues.apache.org/jira/browse/HARMONY-4511
>> > >> Project: Harmony
>> > >> Issue Type: Bug
>> > >> Components: DRLVM
>> > >> Environment: Windows x86
>> > >> Reporter: Eugene S. Ostrovsky
>> > >>
>> > >>
>> > >> Objects tagged with SetTag() jvmti function are not collected by
>> GC v5.
>> > >> I'm not sure whether the bug is in GC or in jvmti heap iteration
>> > >> implementaion.
>> > >>
>> > >>
>> > >> --
>> > >> This message is automatically generated by JIRA.
>> > >> -
>> > >> You can reply to this email to add a comment to the issue online.
>> > >>
>> > >>
>> > >
>> > >
>> >
>> >
>> > --
>> > Gregory
>> >
>> >
>>
>>
>> --
>> With best regards,
>> Alexei,
>> ESSD, Intel
>>
>
>
--
Gregory
--
Gregory