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.
Netbeans IDE closes unexpectedly if a long line is printed into output window. For example, a line of about 6M characters sent from a JSP page as a single line to the Tomcat's output window in IDE (via System.out.print) will close the IDE. Tomcat does not exit, however, it has no console furthermore. There is no additional information in Netbeans logs. Background (why I need to print such a long line): Originally, I found this problem when debugging a web-service client. A SOAP message generated by Axis was printed to the application log (i.e. the output window in Netbeans). Everything was okay up to the case when the client was sending a large file (about 4MB), which was (according to WSDL) encoded into a base64Binary element. It is a problem of Axis that it generates such a long line in elements of base64Binary type (without inserting line ends), but I still think Netbeans should get over such a situation. At least, there should be some error message window or a message in var/log/messages.
Created attachment 36358 [details] Sample JSP file that closes the IDE
a crash is usually a jdk issue, not of the application. on my macosx, it doesn't crash but it hangs close to an halt. it doesn't deadlock, but it seems to have a lot of problems displaying such a big line. I tried both the line wrappign and non wrapping modes. the default textview mode hangs and doens't display the lines I think. the wrapped view displays something but the repaints when moving the scrollbar also hang the ide. probably very hard to fix as the textcomponents in swing cannot probably handle such a load.
getting different output now: I get OOME exceptions now the IDE either recovers or stops responding. Seems to happen on Jboss, while glassfish is ok. The glassfish server seems to put each print() on separate line and cuts the output to a given number of lines. java(14007,0x1b9b400) malloc: *** vm_allocate(size=2408448) failed (error code=3) java(14007,0x1b9b400) malloc: *** error: can't allocate region java(14007,0x1b9b400) malloc: *** set a breakpoint in szone_error to debug INFO [null]: Failed to memory map output file for reading. Trying to read it normally. SEVERE [global] java.io.IOException: Cannot allocate memory at sun.nio.ch.FileChannelImpl.map0(Native Method) at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:742) [catch] at org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:281) at org.netbeans.core.output2.AbstractLines.getText(AbstractLines.java:105) at org.netbeans.core.output2.OutputDocument.getText(OutputDocument.java:172) at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1641) at org.netbeans.core.output2.OutputDocument.fireDocumentEvent(OutputDocument.java:488) at org.netbeans.core.output2.OutputDocument.access$200(OutputDocument.java:41) at org.netbeans.core.output2.OutputDocument$4.run(OutputDocument.java:415) at org.openide.util.Mutex.doEvent(Mutex.java:1181) at org.openide.util.Mutex.readAccess(Mutex.java:287) at org.netbeans.core.output2.OutputDocument.stateChanged(OutputDocument.java:412) at org.netbeans.core.output2.AbstractLines.run(AbstractLines.java:196) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) WARNING [null]: OOME while reading output. Cleaning up. java.lang.OutOfMemoryError at sun.misc.Unsafe.allocateMemory(Native Method) at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:99) at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288) at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:57) at sun.nio.ch.IOUtil.read(IOUtil.java:205) at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:145) at org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:293) at org.netbeans.core.output2.AbstractLines.getText(AbstractLines.java:105) [catch] at org.netbeans.core.output2.OutputDocument.getText(OutputDocument.java:172) at javax.swing.text.DefaultCaret$Handler.insertUpdate(DefaultCaret.java:1641) at org.netbeans.core.output2.OutputDocument.fireDocumentEvent(OutputDocument.java:488) at org.netbeans.core.output2.OutputDocument.access$200(OutputDocument.java:41) at org.netbeans.core.output2.OutputDocument$4.run(OutputDocument.java:415) at org.openide.util.Mutex.doEvent(Mutex.java:1181) at org.openide.util.Mutex.readAccess(Mutex.java:287) at org.netbeans.core.output2.OutputDocument.stateChanged(OutputDocument.java:412) at org.netbeans.core.output2.AbstractLines.run(AbstractLines.java:196) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
more observations (build 070827): the jboss nor glassfish support dont really print the output as one line, but spit each System.out.print(0 on separate line. the same code in j2se project's main() method will print out one line only in the correct way. However it seems to wait for the whole line to be processed and the scrolling is slow.. no OOME exception though..
The issue only appears if the output window keeps on showing the end of the outputted text. If the user clicks into the OW and lets the output finish and then scrolls over the data, nothing happens. The problem is primarily in the way FileMapStorage.getReadBuffer() is implemented. Always just the end of file can be mapped. As the file grows, new and new requests for memory mapping of sections not covered are coming in. There's no way to explicitly get rid of old mapping (it will get GCed eventually), so the old ones stay around for a while. That's when the OOME exception appears. I don't have a solution off hand. It seems the whole idea of memory mapping needs to be discarded and eventually replaced by something else.
*** Issue 111296 has been marked as a duplicate of this issue. ***
Build: NetBeans IDE 6.0 Beta 1 (Build 200709141330) VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04 OS: Linux, 2.6.18-4-k7, i386 User Comments: Tomcat in debugging mode. Logs of tomcat caused such an exception - to much logs or sth else.
Created attachment 50393 [details] stacktrace
Build: NetBeans IDE 6.0 Beta 1 (Build 200709141330) VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04 OS: Windows XP, 5.1, x86 User Comments:
Created attachment 51165 [details] stacktrace
Build: NetBeans IDE 6.0 Beta 2 (Build 200710212201) VM: Java HotSpot(TM) Client VM, 1.5.0_13-b05 OS: Windows 2003, 5.2, x86 User Comments: Checking out NetBeans source code from NetBeans CVS repository
Created attachment 51466 [details] stacktrace
Reassigning to new module owner Tomas Holy.
This issue has already 50 duplicates
te latest report is in 6.1 beta - http://statistics.netbeans.org/analytics/detail.do?id=35520 Tomasi, the issue has 50 duplicates, could you look at it. We do take issues with lot of duplicates seriously. It might happen that the priority will increase soon.
Fixed: http://hg.netbeans.org/core-main/rev/0ac7e3a5c5a9 or http://hg.netbeans.org/main/rev/0ac7e3a5c5a9 There are also performance fixes for very long lines for both wrapped and unwrapped modes.
This issue has already 100 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=85
verified in: Product Version: NetBeans IDE 6.5 RC1 (Build 200810151402) Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-133 System: Mac OS X version 10.5.5 running on i386; MacRoman; en_US (nb) Userdir: /Users/petr/.netbeans/6.5rc1