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 a very large project and every single time I try to run a memory profile on it, the profiler crashes in netbeans when it instruments the 3,435th class. This happen under Suse 10.1 64 bit and under Windows XP 64 bit with both Java 1.6.0 and 1.6.0_1 (I haven't tried it on any other platforms). Here is the error: java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.sun.tools.profiler.instrumentation.SingleMethodScaner.initBytecodesArray(SingleMethodScaner.java:147) at com.sun.tools.profiler.instrumentation.SingleMethodScaner.setClassAndMethod(SingleMethodScaner.java:42) at com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.hasNewOpcodes(MemoryProfMethodInstrumentor.java:125) at com.sun.tools.profiler.instrumentation.ObjLivenessMethodInstrumentor.methodNeedsInstrumentation(ObjLivenessMethodInstrumentor.java:42) at com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.findAndMarkMethodsToInstrumentInClass(MemoryProfMethodInstrumentor.java:107) at com.sun.tools.profiler.instrumentation.MemoryProfMethodInstrumentor.getMethodsToInstrumentUponClassLoad(MemoryProfMethodInstrumentor.java:71) at com.sun.tools.profiler.instrumentation.Instrumentor.createFollowUpInstrumentMethodGroupResponseForMemoryProfiling(Instrumentor.java:463) at com.sun.tools.profiler.instrumentation.Instrumentor.createFollowUpInstrumentMethodGroupResponse(Instrumentor.java:157) at com.sun.tools.profiler.ProfilerClient.instrumentMethodGroupFollowUp(ProfilerClient.java:901) at com.sun.tools.profiler.ProfilerClient.access$2900(ProfilerClient.java:46) [catch] at com.sun.tools.profiler.ProfilerClient$SeparateCmdExecutionThread.run(ProfilerClient.java:1603)
*** Issue 104571 has been marked as a duplicate of this issue. ***
*** Issue 104572 has been marked as a duplicate of this issue. ***
I just tried it out in Netbeans 5.5.1 with the 5.5.1 profiler and did not get the error.
5.5.1 of the profiler fixed the issue under Linux but the exact same error remains under Window XP 64.
Please provide more information. Attach NetBeans IDE message.log (<nb_user_home>/var/log/ messages.log), console output from profiled application whould be also handy. Are you able to prepare reproducible test case? Thanks.
I see this one, too. I am running 5.5.1 on Linux (32-bit) with Sun JDK 1.6.0_01. I have attached my messages.log.
Created attachment 43452 [details] messages.log
I've kept at this one and found that it's a problem with ClassInfo and ClassFileParser using char variables for lengths and offsets that can exceed 65536 bytes. I have attached the classfile that causes the problem. It's _jspService methodInfoLength is 91859, which when truncated to a char is less than the bytecode length of 57223, which ultimately results in the ArrayIndexOutOfBoundsException.
Created attachment 43456 [details] Class file with large _jspService method
Thanks for catching this patrick133t. You are right, this huge classfile is the root of the problem. Lowering priority to P2.
Fixed in trunk.
apb, patrick133t, could you please verify this issue?
*** Issue 130472 has been marked as a duplicate of this issue. ***