NetBeans IDE is scanning/parsing/indexing for ages? Yes, it's a bug!
Problem: "Scanning in progress..." - I believe that everyone have met the issue. You open some larger project and you can not use the NetBeans IDE for a few minutes until the sources are "scanned", whatever it means...
Some unsorted facts first
- Scanning is needed and must be performed, otherwise features that need a knowledge of the source code structure (code completion, refactoring, go to ...) could not be used.
- Only the first scanning should take long - the result is cached in your userdir ($HOME/.netbeans/$VERSION) and further parsing is incremental (only the part that is modified is scanned again).
- Various things may influence the scanning performance, see FaqScanningAndIndexingPerformanceHints.
- Scanning itself is often not a problem - the problem is if the IDE is not very usable while scanning is in progress. E.g. navigation should mostly work even during scanning. See also IDEUsableWhenScanning.
- Scanning&indexing issues are closely watched by the NetBeans dev team, always eager to fix reported problems - if receiving good reports.
Submitting scanning&indexing issues
If you are in the situation when the scanning&indexing takes too much time or if the IDE freezes during scanning a project, it is an issue. The only way to increase the chance someone is able to fix it is to submit the issue and to have enough patience to handle the issue (reply questions, provide more details, don't get offended by developer's questions/comments...).
If you think that you are in a situation when long scanning should not happen at all
As described above there are situations where the scan is expected (after the IDE start, after doing VCS update operation on big code base) but there can be situations where there is no apparent reason why the IDE should start checking your disk. When you hit such situation please try to simply cancel the scan by hitting the cancel icon in the progress indicator showing the scan. You will be prompted to supply a report about unneeded scan - please submit such report so we can deal with similar situations.
What you need to do in order to file a useful bug report on scanning
- In order to improve logging of the scanning related issues, please run IDE with a command-line switch that improves logging:
If you happen to see scanning-related issues often but unreliably, use this switch permanently (e.g. add it to the netbeans.conf file) so the log is always available when a problem occurs.
- Include the version of NetBeans, Java and OS in you report (copy information from Help>About) and attach IDE log file ($HOME/.netbeans/$VERSION/var/log/messages.log)
- Describe your problem as precisely as you can but please try to be brief too (these requirements are contradictory). Specifically for scanning issues, include the answers to following questions:
- Does the scanning ever finish?
- If yes, how long did it take?
- Was it only the first scan issue, or is the problem met whenever you open the project?
- If scanning didn't finish, did IDE freeze so that it needs to be killed?
- If yes, did the main window repaint (was AWT blocked)?
- Provide as much information about your project's setup as you can - we cannot reproduce all bugs as we don't have every possible setup:
- What is your project type?
- How big is your project (number of classes, disk size, ...)?
- Does your project use some libraries (how many)?
- What is the structure of your project (i.e.: long "string of dependencies"...)?
- Is your project public, so that everyone can get the sources and open it?
- It very often happens that the performance issues are a result of some specific setup and they can be unrelated to the place where they actually occur - we need to identify possible external cause of the problem:
- Do you use any version control system for your project?
- Is your project located on the network drive?
- When you meet some performance problem and you intend to submit an issue, please don't forget to capture a thread dump or a profiler snapshot so that we can readily see where the activity is.
These are the points that I see as the most important when submitting the scanning and indexing issues. If you think of some other information that can be useful, please add your comment/hint to the discussion...