get heap memory used by a method in a java class
<p>i m writing a java code and i want run some performance tests .
I want to get the heap  memory used by only one of the methods in my class.</p>

<pre><code> public AccessControl {

     public boolean Allowed () {
        code
        }
     public  void print () {
    code }
}
</code></pre>

<p>i want to get the heap memory used in java everytime the method Allowed is called at runtime. i read i can do it through HPROf but i noticed that HPROf doesnt provide memory calculations for methods but only for classes is there a code i can write inside the method to get the available memory and then the used memory? thanks</p>
