Code review request: JDK-8005048,NMT: #loaded classes needs to just show the # defined classes

David Holmes david.holmes at oracle.com
Mon Dec 17 18:41:19 PST 2012


Hi Zhengyu,

On 18/12/2012 6:11 AM, Zhengyu Gu wrote:
> Current NMT implementation reports number of loaded classes at query
> time, but number of defined classes is what is expected.
>
> This changset reflects two major changes:
>
> 1. It counts number of defined classes vs. number of loaded classes

Can you explain what the distinction is please? I don't know what a 
"defined class" is.

> 2. It counts number of defined classes for each generation, vs. counts
> at query time. In this way, the number of defined classes that NMT
> reports, should match the corresponding class metadata data. As the
> result, the data should be more accurate.
>
>
> Webrev: http://cr.openjdk.java.net/~zgu/8005048/webrev.00/

I think we could benefit from NMT_ONLY(x) macros to get rid of the 
one-line conditional blocks eg in instanceKlass.cpp

---

src/share/vm/oops/instanceKlass.hpp

+ #if INCLUDE_NMT
+   static int number_of_instance_classes() { return 
(int)_total_instanceKlass_count; }
+
+  private:
+   static volatile jint _total_instanceKlass_count;
+ #endif

Why are we mixing int and jint here?

---

I can't comment on the detailed memory management of the GenerationData.

David
-----


>
> Thanks,
>
> -Zhengyu


More information about the hotspot-dev mailing list