JPDA Architecture Research 14-agent using environment pointers to access VMs (Object Management chapter)

Source: Internet
Author: User

Introduced:

The above discusses how an agent can access a VM using an environment pointer (management Class), which discusses how to manage objects.


Category 9: Object management

A.getobjectsize. Gets the size of the object,

Jvmtierrorgetobjectsize (jvmtienv* env, Jobject object, jlong* size_ptr)

Note that this is not true size, which is just a pre-estimate obtained from the object's definition code.


B.getobjecthashcode. Gets the hash value of the object.

Jvmtierrorgetobjecthashcode (jvmtienv* env, Jobject object, jint* hash_code_ptr)


C.getobjectmonitorusage. Gets the monitor for the object.

typedef struct {Jthread owner;    Jint Entry_count;    Jint Waiter_count;    Jthread* Waiters;    Jint Notify_waiter_count; jthread* Notify_waiters;} Jvmtimonitorusage;
Jvmtierrorgetobjectmonitorusage (jvmtienv* env, Jobject object, jvmtimonitorusage* info_ptr)

This method is worth saying, as you can see from the return value, that it can contain the following information for the object's monitor:

(1) The thread on which the monitor resides

(2) The number of times a thread has entered the monitor

(3) The number of threads waiting to have this monitor.

(4) Wait for the list of threads that have this monitor.

(5) The number of threads waiting to be notified by this monitor.

(6) A list of threads waiting to be notified by this monitor.

This article is from the "cohesion of parallel Lines" blog, please be sure to keep this source http://supercharles888.blog.51cto.com/609344/1587822

JPDA Architecture Research 14-agent using environment pointers to access VMs (Object Management chapter)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.