Bug 134974 - Netbeans 6.1 hangs on startup after fresh install.
Netbeans 6.1 hangs on startup after fresh install.
Product: editor
Classification: Unclassified
Component: -- Other --
PC Linux
: P2 (vote)
: 6.x
Assigned To: Jan Jancura
Depends on:
  Show dependency treegraph
Reported: 2008-05-13 16:24 UTC by sreque
Modified: 2008-07-21 10:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT

output of jstack -l during a period where netbeans used an entire core and remained unresponsive for half a minute or longer (26.87 KB, text/plain)
2008-05-19 17:05 UTC, sreque
output of jmap -histo when netbeans memory usage was over 600 MB (433.00 KB, text/plain)
2008-06-02 20:58 UTC, sreque

Note You need to log in before you can comment on or make changes to this bug.
Description sreque 2008-05-13 16:24:28 UTC
After performing a fresh install of netbeans 6.1 complete on my system, I attempt to start the IDE up. After the bottom
left corner displays the text "Done Loading Modules", the progress bar halts and when I tab out and back in the window
greys out, showing that the application is no longer responding. I tried to then uninstall and reinstall only with the
componenents I was interested in, Java, c++, ruby, and UML, but got the same results.
Comment 1 sreque 2008-05-13 16:28:09 UTC
When I run the netbeans launcher script in bins/netbeans from the command line, I get the following output.

Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb7fcd767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb7fcd8b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0xb3eb31bd]
#3 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so [0xb41938ce]
#4 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so [0xb4170067]
#5 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so [0xb4170318]
#6 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0xb417061f]
#7 [0xb5bacecd]
#8 [0xb5ba5edd]
#9 [0xb5ba5edd]
#10 [0xb5ba3249]
#11 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x621c40d]
#12 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x6310378]
#13 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x621c2a0]
#14 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x363) [0x6272153]
#16 [0xb5bacecd]
#17 [0xb5ba5d77]
#18 [0xb5ba3249]
#19 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x621c40d]
Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb7fcd767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb7fcd81e]
#2 /usr/lib/libX11.so.6 [0xb3eb2518]
#3 /usr/lib/libX11.so.6(XGetVisualInfo+0x26) [0xb3ea90a6]
#4 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so [0xb416f319]
#5 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so [0xb416f565]
#6 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so [0xb41703c9]
#7 /usr/java/jdk1.6.0_04/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0xb417061f]
#8 [0xb5bacecd]
#9 [0xb5ba5edd]
#10 [0xb5ba5edd]
#11 [0xb5ba3249]
#12 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x621c40d]
#13 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x6310378]
#14 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so [0x621c2a0]
#15 /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x363) [0x6272153]
#17 [0xb5bacecd]
#18 [0xb5ba5d77]
#19 [0xb5ba3249]
Comment 2 sreque 2008-05-13 16:58:18 UTC
I tried several things, including reinstalling netbeans  and trying to incrementally load  clusters until the IDE broke,
starting by just loading the ide9 cluster and adding the rest one by one. For some reason, after this latest reinstall,
which was probably the third or 4th reinstall for me, it started working again.
Comment 3 sreque 2008-05-16 18:30:19 UTC
I'm reopening this issue because I had this problem again, though not on a fresh install. I closed netbeans down without
any error or unusual message and then re-opened it. When I reopened the program it hung again as described previously. I
had to issue a kill signal to the process to get it to stop running. This occured each time I tried to start Netbeans.

I then ran nbexec manually and only loaded the nb6 cluster and it started successfully. I added all the clusters back
and started it normally and it suddenly worked again.

Finally, this may or may not be related and may need a new ticket, by after using netbeans c++ for a while, like around
a few hours, its performance degrades to an unusuable state, where the program will frequently use up an entire core and
stop responding to user input for several seconds at a time. Closing every open file and tab doesn't fix the problem. I
have to close the program and restart for it to be useable again. I did not have this problem with netbeans 6.0. Since
right now I only use netbeans c++, I do not know if the issue is related just to that part of the IDE or some other
Comment 4 sreque 2008-05-16 21:48:06 UTC
I'm starting to think the culprit might be the jvi plugin I am using. I am not sure if I have time to figure out how to
profile it right now, as I've never learned how to profile IDE plugins before.
Comment 5 Jana Maleckova 2008-05-19 08:35:22 UTC
there could be more reasons which leads to this state. Please catch thread dump when IDE gets stuck. This should help to
find out the reason why this happen. http://wiki.netbeans.org/GenerateThreadDump
Please enclose build number, jdk version and platform you are running on as well
Comment 6 sreque 2008-05-19 17:05:30 UTC
Created attachment 61573 [details]
output of jstack -l during a period where netbeans used an entire core and remained unresponsive for half a minute or longer
Comment 7 sreque 2008-05-19 17:10:47 UTC
Here's what the about window in netbeans displays. I don't know much about AWT, but it looks like from the stack dump
that both the Event Queue thread and another AWT thread were blocked, along with the CPP Parser. CPU usage the whole
time hovered at 50%, fully consuming one core, and the netbeans window would not redraw itself or respond to input.

Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Linux version 2.6.24-16-generic running on i386; UTF-8; en_US (nb)
Comment 8 sreque 2008-05-19 17:25:22 UTC
The netbeans IDE continued to be unresponsive after I submitted stackdump.txt. I eventually closed it out and tried to
restart it and it froze again, forcing me to kill it with a TERM signal. I then restarted netbeans with the following

nbexec --userdir /home/sreque/.netbeans/6.1 --jdkhome /usr/java/latest --branding nb --clusters
/home/sreque/netbeans-6.1/nb6.1 -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade
-J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense -J-Xmx365m -J-client -J-Xss2m -J-Xms32m
-J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true

This is the same command as is eventually invoked with the netbeans executable script, except that all clusters have
been deleted except nb6.1. A dialogue box informed me that the following plugins could not be loaded:

Warning - could not install some modules:
	jVi KeyBindings - The module named org.netbeans.modules.editor/3 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.editor.completion/1 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.editor.fold/1 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.editor.indent/2 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.editor.lib/1 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.editor.lib2/1 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.editor.settings/1 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.projectapi/1 was needed and not found.
	jVi KeyBindings - The module named org.netbeans.modules.projectuiapi/1 was needed and not found.
	Welcome Screen - The module named org.netbeans.modules.projectapi/1 was needed and not found.
	Welcome Screen - The module named org.netbeans.modules.projectuiapi/1 was needed and not found.
	Welcome Screen - The module named org.netbeans.modules.projectui was needed and not found.
	NetBeans 6.1 - The module named org.netbeans.modules.ide.kit was needed and not found.
	Another module could not be installed due to the above problems.

I clicked "disable and continue" and loaded the IDE. I then closed it out and restarted netbeans as normal. At this
point both the jvi keybindings plugin, the only 3rd party plugin I've installed, as well as the NetBeans 6.1 plugin,
were disabled, and I proceeded to activate both of them. Once I activated them, I closed netbeans again and re-opened it
to ensure that everything was working normally again.

This is what I've been repeatedly doing each time netbeans becomes unresponsive and I close it out to get it working again.
Comment 9 sreque 2008-05-22 23:29:30 UTC
It looks like some of this problem may be caused by a memory leak. I manually upped the max memory footprint for the JVM
and netbeans has lasted the longest ever, but it is currently using 1.1 GB of memory and there's not much left for it to
commandeer. Is there an easy way to determine what components are using what memory?
Comment 10 sreque 2008-05-22 23:53:21 UTC
I closed netbeans just to free some memory, not because it was having performance problems. The IDE was responding very
well still, though it was of course using 1.1 GB of memory. Even still, I once again could not restart it. I had to go
through my normal routine to get it working again.
Comment 11 Peter Pis 2008-06-02 12:02:09 UTC
Reassigning to "editor" for evaluation.
Comment 12 Dusan Balek 2008-06-02 12:30:42 UTC
Could you please attach a jmap histogram (jmap -histo <pid>)? Thanks.
Comment 13 sreque 2008-06-02 20:58:04 UTC
Created attachment 62282 [details]
output of jmap -histo when netbeans memory usage was over 600 MB
Comment 14 sreque 2008-06-13 18:36:53 UTC
After updating both cnd (1.3.0 -> 1.3.1) and jvi (1.1.5 -> 1.1.6), the hanging problem seems to have gone away. The only
problem left is the memory leak problem, which is easily worked around by restarting netbeans once it has eaten more
memory than is good for it. Should I close this ticket now?
Comment 15 Miloslav Metelka 2008-06-18 09:21:53 UTC
I have downgraded the priority to P2. We should attempt to get rid of the memory leak.
I see 33 NbEditorDocument instances in the attached jmap output. Don't you remember how many files there were opened in
the editor at the time of taking the jmap snapshot? Or could you possibly attempt to open multiple files in the editor
and then close them all and do the garbage collection in the memory bar and then take a snapshot and look for how many
"NbEditorDocument" instances there were? This way you can easily determine whether the documents are leaking or not. Thanks.
 Also there was 565722 line elements in the dump which would indicate that in average each file would have 565722 / 33 =
17143 lines which is rather high number. Have you edited any large files with let's say >10000 lines or not?
 The computed number of lines-per-file can possibly not be accurate since certain line elements can get created if you
type in a file and they can still be held by an undo manager's queue. Especially the number could grow if you perform
operations that do many edits e.g. code reformatting.
Comment 16 sreque 2008-06-19 15:12:44 UTC
Never mind, Netbeans froze on me again on startup. I had let the memory footprint get up to 1 GB before closing it that
time. I remember once trying to deal with the memory leak by closing all documents but it didn't seem to make a
difference. Next time I will start a garbage collection as well.

So I opened up netbeans, opened a bunch of documents so that it's memory usage was about 300 or 400 out of 500 MB,
closed all the documents with ctrl+shift+f4, and click on the memory bar. The memory usage dropped to 250 out of 500,
whereas netbeans was only using about 70-90 out of 200 at startup. Also, I don't think I know the normal behavior for
the JVM gc, but the gc run didn't return any memory to the operating system and the system monitor still reported
Netbean's footprint at 500 MB as well. Finally, the snapshot reported that were 54 NbEditorDocument instances, even
though no actual documents were open.

Finally, the C files I'm working on are that big :). The largest ones are over 50K lines and trip the warning dialog
that the file is over 1 MB. Netbeans overall handles it more  well enough for my machine and the semantic
parser/analyzer's performance seems to be much better than that of the Eclipse CDT, except for the memory leaks and
startup freezes.

I hope that helps. Let me know if there is anything else I can do or report!
Comment 17 Jan Lahoda 2008-07-07 18:07:23 UTC
See also issue #138611.
Comment 18 sreque 2008-07-12 18:33:01 UTC
I don't know if it's the direct cause, but for a while the startup freezes disappeared almost completely. Recently, I
updated netbeans when prompted, and among other things CND was updated from 1.3.1 to 1.3.2. The freezes on startup are
back and have occurred consistently the last 3 or 4 times I've had to restart the IDE. Performance seems to have
suffered a little as well.
Comment 19 Jan Becicka 2008-07-17 08:27:50 UTC
Hanzi, please take a look at it. Thanks
Comment 20 Jan Jancura 2008-07-21 10:37:12 UTC
Looks like its caused by #138611. It means that it should be fixed now. Feel free to reopen this issue if you are still
able to reproduce it.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo