This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE Dev (Build 200709271200) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 System: SunOS version 5.10 running on x86; ISO646-US; en (nb) X.class.newInstance() type of object creation is not recorded by the profiler. Allocation via the new operator is recorded just fine. This issue becomes more relevant the bigger the application where reflection is used more often. When I perform allocation memory profiling (each 1 object allocation, no stack traces) of attached application, it creates 1000 Object instances, but profiler shows only 17. See also issue 71792
Sample application: http://www.netbeans.org/nonav/issues/showattachment.cgi/49733/Main.java
The problem is caused by so called "Inflation" mechanism. Reflection uses native code for first few invocations (default threshold is 15) and than switches to artificially generated classes to create new instances. Class.newInstance() caches default constructor and therefore you see only 16 instances. it works fine on other cases, since the java.lang.reflect.Constructor is not reused and therefore there is no inflation. Lowering priority to P3, since this is not common case. Since inflation threshold can be controlled by system property sun.reflect.inflationThreshold, there is easy workaround - run application with -Dsun.reflect.inflationThreshold=1000000
Fixed in trunk.