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.
Changing the active Node in my platform application becomes very sluggish if the system clipboard happens to contain a large image (e.g. due to having a screenshot on the clipboard). If the clipboard contents is sufficiently large (e.g. a 3000x3000px image copied from Photoshop), I get the following stack trace whenever I select a new node (e.g. in the "Projects" or "Files" tab, with nothing else open): java.lang.OutOfMemoryError: Java heap space at sun.lwawt.macosx.CClipboard.getClipboardData(Native Method) at sun.awt.datatransfer.ClipboardTransferable.fetchOneFlavor(ClipboardTransferable.java:117) at sun.awt.datatransfer.ClipboardTransferable.<init>(ClipboardTransferable.java:97) at sun.awt.datatransfer.SunClipboard.getContents(SunClipboard.java:147) at org.netbeans.NbClipboard.getContents(NbClipboard.java:227) at org.netbeans.modules.openide.explorer.ExplorerActionsImpl$ActionStateUpdater.updateTrans(ExplorerActionsImpl.java:818) at org.netbeans.modules.openide.explorer.ExplorerActionsImpl$ActionStateUpdater.run(ExplorerActionsImpl.java:797) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042) The problem seems to be that ExplorerActionsImpl.ActionStateUpdater.updateTrans() calls NbClipboard.getContents(), which is potentially expensive depending on the contents of the clipboard on every single node update. I'm running MacOS X Mavericks--not sure if this bug applies to Windows as well. I can't yet reproduce the OutOfMemoryError from the IDE--presumably it has a higher heap size by default.
Created attachment 146035 [details] .npss file attached from NetBeans .npss file
OK, I'm definitively able to reproduce the sluggishness in the regular NetBeans IDE now, not just from my platform application. With a 4000x4000px image copied from Photoshop to the clipboard, moving up and down the nodes in the "Projects" tab with the keyboard becomes sluggish. Attaching an IDE profiling snapshot, taken while moving quickly between nodes in the projects tab. Look at the "Hot Spots" to find ActionStateUpdater.updateTrans() consume 36 seconds (due to calls to NbClipboard.getContents).
Hmm, it gets worse. Applications like Excel expose text on the clipboard not only as text, but as a bitmap image as well, and NbClipboard.getContents appears to load the data in the image as well. Sometimes these images can get quite large, slowing down node selection in NetBeans (and causing OutOfMemoryErrors in my platform application). So this problem is more generally applicable than just for people who happen to be using Photoshop.
*** This bug has been marked as a duplicate of bug 233513 ***