Hello, sorry to bother you! I am a non-English speaker, so my English is not very standard. But i will try to make myself understood. I am wondering if you'd give me a hand about how to use JVMTI. To be specific, i'd like to profile a method, within which , i'd like to know, how many bytes are allocated in the heap. If this method invocates another method, then what about the size of the combination of the two methods? In addition, since the above-mentioned function can be utilized in JPprofiler, whether BCI( bytecode instrumentation ) should be used or not if i'd like to use JVMTI to implement the funtion. Meanwhile, if possible, would you mind sharing some code with me ? If not, would you like to give some hints? Or would you share some materials concerning BCI with me, who is green in it.
Thank you for you time! I really appreciate it !
BCI is the best solution for your profiling. Have you used hprof? If not try it. It is a demo tool from sun and its source
code is available for free to use under GPL. This is a good start for you.
Download the jdk source from this [link http://download.java.net/openjdk/jdk7/ |http://download.java.net/openjdk/jdk7/].
And take a look at the hprof source in src/share/demo/jvmti/hprof directory. I hope this helps.