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.

Bug 51394 - ArrayIndexOutOfBoundsException in tool when many methods are instrumented
Summary: ArrayIndexOutOfBoundsException in tool when many methods are instrumented
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: mishadmitriev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-10 20:18 UTC by sreimers
Modified: 2007-02-20 18:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example StackTrace (684 bytes, text/plain)
2004-11-10 20:20 UTC, sreimers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sreimers 2004-11-10 20:18:40 UTC
Attaching to a running NetBeans based Application
leads to the attached
ArrayIndexOutOfBoundsException. I tried to attach
at different state of the application but all the
time this seems to happen reproducable.

Found with Nb4 beta 2 and last q-build
200411020931. Milestone used is 3.
Comment 1 sreimers 2004-11-10 20:20:42 UTC
Created attachment 18833 [details]
Example StackTrace
Comment 2 mishadmitriev 2004-11-11 00:51:57 UTC
This may be caused by the tool attempting to instrument too many 
methods and thus causing an internal overflow which we didn't 
anticipate. To confirm this theory, could you please tell us:
1. Whether you try to use the "Entire application" CPU profiling mode 
for a large enough application.
2. If 1 is true, then do you see the "Instrumentation: nnn methods" 
in the bottom status line in NetBeans? If yes, what's the value 
of "nnn"?

If nnn above is a large number (probably greater than 64K) then a 
workaround for this problem may be to use the "part of application" 
instead of "entire application" profiling mode, and select your 
instrumentation root method(s) such that only a limited part of the 
application gets instrumented.

In any case, please provide answers to the above questions. Thanks,

Misha
Comment 3 mishadmitriev 2004-11-11 04:16:14 UTC
Reproduced the problem and partially fixed it - increased the 
internal limit on the number of instrumented methods from 32K to 64K. 
Changes related to further limit increase may affect performance 
severely, so I think it will be ok to just modify the tool to issue a 
warning and stop further instrumentation when the 64K methods limit 
is reached (which should be ok with most of applications as far as I 
can see now).

Can send the user a patch to test if requested.
Comment 4 sreimers 2004-11-11 09:36:40 UTC
-Can confirm "Entire application" CPU profiling mode  for rather large
application

-Can confirm "Instrumentation: nnn methods" in the bottom status line 
nnn = 34234 , exception seems to occure at 32k Methods. 

Patch to test would be nice.
Comment 5 sreimers 2004-11-13 18:11:02 UTC
Received patch - seems to wrk like a charme.

Thanks Misha - that was fast!
Comment 6 mishadmitriev 2004-11-16 03:15:17 UTC
Fixed the issue completely - the profiler reports when the 64K limit 
on the number of instrumented methods is reached, and stops further 
instrumentation. Code will be available in Milestone 4 release.
Comment 7 ehucka 2006-10-09 12:09:25 UTC
Verification of old issues.
Comment 8 Alexander Kouznetsov 2007-02-12 22:56:37 UTC
Closing old issues.
Comment 9 Alexander Kouznetsov 2007-02-20 18:22:48 UTC
Reverting to the original Target Milestone value changed by mistake. Sorry for
inconvenience.