<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">12.03.2015 15:55, Mikael Gerdin пишет:<br>
    </div>
    <blockquote cite="mid:55018CCB.2020204@oracle.com" type="cite">Andrey,
      <br>
      <br>
      On 2015-03-12 12:51, Andrey Zakharov wrote:
      <br>
      <blockquote type="cite">Tested in aurora as
        742910.VMSQE.adhoc.JPRT.full. Looks good.
        <br>
        Thanks.
        <br>
        <br>
        11.03.2015 20:17, Andrey Zakharov пишет:
        <br>
        <blockquote type="cite">
          <br>
          09.03.2015 15:26, Thomas Schatzl пишет:
          <br>
          <blockquote type="cite">Hi Andrey,
            <br>
            <br>
            On Tue, 2015-03-03 at 18:40 +0300, Andrey Zakharov wrote:
            <br>
            <blockquote type="cite">Fixed according comments.
              <br>
              <br>
              hotspot webrev:
              <br>
              <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~azakharov/8061715/webrev.06/">http://cr.openjdk.java.net/~azakharov/8061715/webrev.06/</a>
              <br>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
      <br>
      The following code is not correct with regards to the safepoint
      protocol. You should not perform the ToNativeFromVM transition
      until you have received the data from the VM. After the transition
      a GC pause may occur while you are executing in
      get_auxillary_data_memory_usage and you can get strange results.
      <br>
      <br>
       328 WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
      <br>
       329   ResourceMark rm(THREAD);
      <br>
       330   ThreadToNativeFromVM ttn(thread);
      <br>
       331   G1CollectedHeap* g1h = G1CollectedHeap::heap();
      <br>
       332   MemoryUsage mu = g1h->get_auxiliary_data_memory_usage();
      <br>
       333
      <br>
       334   jclass jclass_memory_usage =
      env->FindClass("java/lang/management/MemoryUsage");
      <br>
       335   CHECK_JNI_EXCEPTION_(env, NULL);
      <br>
       336   if (jclass_memory_usage == NULL) {
      <br>
      <br>
      I just found out that there is an existing function which creates
      a java.lang.management.MemoryUsage from a C++ MemoryUsage object,
      <br>
      MemoryService::create_MemoryUsage_obj(MemoryUsage usage, TRAPS)
      <br>
      <br>
      Using this you can get rid of the state transition altogether and
      do something like:
      <br>
      <br>
      WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
      <br>
        G1CollectedHeap* g1h = G1CollectedHeap::heap();
      <br>
        MemoryUsage mu = g1h->get_auxiliary_data_memory_usage();
      <br>
        Handle h = MemoryService::create_MemoryUsage_obj(usage,
      CHECK_NULL);
      <br>
        return JNIHandles::make_local(env, h());
      <br>
      WB_END
      <br>
      <br>
      This code is almost the same as jmm_GetMemoryPoolUsage in
      management.cpp so if it doesn't compile see if I've missed
      something.
      <br>
      I'm pretty sure you don't need a ResourceMark for this function
      since it does not allocate any memory in the resource area.
      <br>
      <br>
      /Mikael
      <br>
    </blockquote>
    <br>
    Hi, Mikael. Thanks for the tip. It makes things better here. But I'm
    in doubt about needless of ResourceMark. It exists in mentioned  <b>jmm_GetMemoryPoolUsage:<br>
      <br>
    </b><tt>JVM_ENTRY(jobject, jmm_GetMemoryPoolUsage(JNIEnv* env,
      jobject obj))</tt><tt><br>
    </tt><b><tt>  ResourceMark rm(THREAD);</tt></b><tt><br>
    </tt><tt><br>
    </tt><tt>  MemoryPool* pool = get_memory_pool_from_jobject(obj,
      CHECK_NULL);</tt><tt><br>
    </tt><tt>  if (pool != NULL) {</tt><tt><br>
    </tt><tt>    MemoryUsage usage = pool->get_memory_usage();</tt><tt><br>
    </tt><tt>    Handle h = MemoryService::create_MemoryUsage_obj(usage,
      CHECK_NULL);</tt><tt><br>
    </tt><tt>    return JNIHandles::make_local(env, h());</tt><tt><br>
    </tt><tt>  } else {</tt><tt><br>
    </tt><tt>    return NULL;</tt><tt><br>
    </tt><tt>  }</tt><tt><br>
    </tt><tt>JVM_END</tt><b><br>
      <br>
    </b><b><br>
    </b>
    <blockquote cite="mid:55018CCB.2020204@oracle.com" type="cite">
      <br>
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <blockquote type="cite">
              <br>
              hs-gc webrev:
              <br>
<a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~azakharov/8061715/webrev.06/hs-gc/">http://cr.openjdk.java.net/~azakharov/8061715/webrev.06/hs-gc/</a>
              <br>
              <br>
              testing: in progress
              <br>
            </blockquote>
            Can you also provide the webrev for the hs-gc repository
            with the
            <br>
            changes to whitebox.java?
            <br>
          </blockquote>
          Its provided.
          <br>
          testing looks good, latest on sthjprt as
          2015-03-11-152816.gtee.auxdata
          <br>
          Thanks.
          <br>
          <br>
          <blockquote type="cite">Thanks,
            <br>
               Thomas
            <br>
            <br>
            <br>
            <br>
          </blockquote>
          <br>
        </blockquote>
        <br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>