Hi Mike,
I used “junk” object to represent unintentional object retention (eg. forget to set null even after its lifetime).
The way I detect the leak is to compare user specification with actual virtual machine.

For instance:

1 @create(“Group1”) //user annotated
2 public void foo(){
ast = new Tree();
4 bst = new Tree();
5 cst = new Object();
6 }

When method foo() is called, I obtain the annotated info, “Group1” from the annotation, and store that information into the misc header field of any objects created in method foo(), ast, bst, and cat in this case.
I have coded the part to handle methodCompileCallback(…), and I am able to retrieve the group info associated to particular annotated method. But I realize 2 major difficulties that I am seeking suggestion in.

1. methodCompileCallback() only happens when a method is invoked first time (and compiled), if method used multiple times, this callback cannot notify the second time and on.
2. write group info into object header when new object created; the classInstantiatedCallback does not return a handle to the object created so I can’t use it to access the objectModel class. Rafat has pointed me some help, and I am studying on it now.

Any suggestions are welcome. Thanks.

Matthew



On Jun 27, 2014, at 12:12 PM, Michael Bond <mikebond@cse.ohio-state.edu> wrote:

Hi Matthew,

Could you also let us know what's a "junk object"? If it's related to memory leaks or bloat, there are already several projects on those topics implemented in Jikes RVM, available on the Jikes RMV Research Archive: http://sourceforge.net/p/jikesrvm/research-archive/. It might help you to take a look at those (even if you're doing something different, they have examples of how to instrument allocation, tracing, and collection and how to add object header metadata).

Cheers,
Mike

On 06/25/2014 03:07 PM, Matthew Ma wrote:
Hi Eliot,
Thanks for the suggestion; from inspecting the java agent capability, I see that I can use it to instrument the source code (and modify the object). 
However, I need an ability to listen to vm events (such as when a object is created and collected) and modify the object header of an object. Therefore, I found Jike more suited to my purpose. Please kindly correct me if I am wrong.

Thanks again for the feedback, I really appreciate it.

Matthew
On Jun 25, 2014, at 1:02 PM, Eliot Moss <moss@cs.umass.edu> wrote:

On 6/25/2014 8:38 AM, Matthew Ma wrote:
Hi,

My goal is to build a runtime verifier tool to help detect junk objects for user program running on the RVM
For the design, I hope the vm can allow my verifier to be an extension like java agent, where one can do: java -javaagent:agent.jar TestProgram to run TestProgram with my verifier).
Would it be easier to directly modify the RVM (and make my verifier part of the VM), and if so, what classes should I modify to instantiate my verifier along with running RVM?
Why JikeRVM, Matthew?  Couldn't you do this using HotSpot or the IBM
VM, which have much more robust support for agents?

And what does "junk objects" mean anyway? :-)

Regards -- Eliot Moss

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft_______________________________________________
Jikesrvm-researchers mailing list
Jikesrvm-researchers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers