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.
I have an extremely large proprietary project (1700 files and > 70K methods) and I'm trying to profile the entire project, however, the profiler always crashes with the following exception Exception in thread "SubL Thread #1" java.lang.ExceptionInInitializerError at sun.misc.Unsafe.ensureClassInitialized(Native Method) at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25) at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122) at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918) at java.lang.reflect.Field.getFieldAccessor(Field.java:899) at java.lang.reflect.Field.get(Field.java:358) at com.cyc.tool.subl.util.SubLFiles.initialize(SubLFiles.java:70) at com.cyc.cycjava.cycl.cycl.runTopLevelForms(cycl.java:398) at com.cyc.tool.subl.util.SubLFiles.initialize(SubLFiles.java:55) at com.cyc.tool.subl.jrtl.nativeCode.subLisp.Eval.initialize_subl_interface_file(Eval.java:211) at com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLMain.initializeTranslatedSystems(SubLMain.java:184) at com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLMain$2.safeRun(SubLMain.java:463) at com.cyc.tool.subl.jrtl.nativeCode.type.core.SubLProcess.run(SubLProcess.java:147) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) at com.cyc.tool.subl.jrtl.nativeCode.subLisp.SubLThread.run(SubLThread.java:109) Caused by: java.lang.ArrayIndexOutOfBoundsException: -32656 at org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.methodEntry(ProfilerRuntimeCPUSampledInstr.java:287) at org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.rootMethodEntry(ProfilerRuntimeCPUSampledInstr.java:385) at com.cyc.cycjava.cycl.inference.harness.inference_modules.<clinit>(inference_modules.java:73) ... 17 more It looks like the profiler may be inappropriately using byte offests when bytes are not sufficiently large. Note, I really need to profile the the vast majority of code, so picking a few roots isn't sufficient or will pick up everything anyways.
This seems like it might be related to Issue 104573 where the profiler was using chars for offsets into large files that were greater than 32K bytes long.
There is no problem in profiler and this exception has nothing to do with issue #104573. This is a problem in JVM. There is a workaround for it, but it stopped working in JDK 1.6.0_10. Which JDK are you using? 1.6.0_07 should work.
You can also tell HotSpot compiler to exclude org.netbeans.lib.profiler.server.ProfilerRuntimeCPUSampledInstr.methodEntry() method from being compiled. To do so, you will create .hotspot_compiler file in the current working directory of the profiled application and put exclude org/netbeans/lib/profiler/server/ProfilerRuntimeCPUSampledInstr methodEntry See this http://blogs.sun.com/javawithjiva/entry/hotspotrc_and_hotspot_compiler link for more details about .hotspot_compiler *** This issue has been marked as a duplicate of 163211 ***
More info: the JVM bug can be reproduce with Server VM only.
*** Issue 164503 has been marked as a duplicate of this issue. ***
Could someone please post the jdk bug id.