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 172681 - Setting text to the HTML area takes unreasonable amount of time
Summary: Setting text to the HTML area takes unreasonable amount of time
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Hurka
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE, VISUALVM
: 224511 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-21 13:30 UTC by dlipin
Modified: 2014-07-25 02:36 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 158116


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dlipin 2009-09-21 13:30:50 UTC
Build: NetBeans IDE Dev (Build 090921)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86
User comments: 
Maximum slowness yet reported was 6312 ms, average is 5515
Comment 1 Jiri Sedlacek 2009-11-02 10:46:33 UTC
Snapshot model seems to be created in EDT. Probably requires larger changes/redesign.
Comment 2 J Bachorik 2012-04-18 11:01:14 UTC
After studying the reports it is obvious that there are two main culprits:
1. Class loading while the file system is busy - we can not do anything about this, unfortunately
2. Setting quite large HTML text to the HTML text area component

Reassigning
Comment 3 Jiri Sedlacek 2013-01-07 09:36:12 UTC
*** Bug 224511 has been marked as a duplicate of this bug. ***
Comment 4 Jesse Glick 2014-05-29 14:46:42 UTC
Another case of my report 644925 just happened in a dev build, 20140515-0fca87f61f0e. (Running 7u55 on Linux.) The IDE captured a snapshot which ought to have been uploaded, but the exception reporter was also broken:

java.lang.InternalError: java.io.IOException: Stream closed
	at java.text.BreakIterator.createBreakInstance(BreakIterator.java:620)
	at java.text.BreakIterator.getBreakInstance(BreakIterator.java:565)
	at java.text.BreakIterator.getLineInstance(BreakIterator.java:492)
	at javax.swing.text.GlyphView.getBreaker(GlyphView.java:838)
	at javax.swing.text.GlyphView.getBreakSpot(GlyphView.java:793)
	at javax.swing.text.GlyphView.getBreakWeight(GlyphView.java:723)
	at javax.swing.text.html.InlineView.getBreakWeight(InlineView.java:150)
	at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:733)
	at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:233)
	at javax.swing.text.ParagraphView.calculateMinorAxisRequirements(ParagraphView.java:724)
	at javax.swing.text.html.ParagraphView.calculateMinorAxisRequirements(ParagraphView.java:157)
	at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
	at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
	at javax.swing.text.html.ParagraphView.getMinimumSpan(ParagraphView.java:270)
	at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:903)
	at javax.swing.text.html.BlockView.calculateMinorAxisRequirements(BlockView.java:146)
	at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
	at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:568)
	at javax.swing.text.html.BlockView.getMinimumSpan(BlockView.java:378)
	at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:903)
	at javax.swing.text.html.BlockView.calculateMinorAxisRequirements(BlockView.java:146)
	at javax.swing.text.BoxView.checkRequests(BoxView.java:935)
	at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:343)
	at javax.swing.text.BoxView.layout(BoxView.java:708)
	at javax.swing.text.BoxView.setSize(BoxView.java:397)
	at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1714)
	at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:917)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1660)
	at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1332)
	at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:790)
	at …

Anyway, I had opened a 1.5Gb heap dump produced by a JVM getting an OOME. The profiler’s summary page showed the thread which got the OOME and hyperlinked it. So I clicked on the hyperlink. The IDE then froze for four minutes (!) before displaying the list of threads scrolled to the right spot.

If the HTML text area performance cannot be fixed, or a suitable replacement (like the Output Window control) found, please just remove this feature. I would rather do without it than risk having my work stopped for this long without warning.
Comment 5 Milos Kleint 2014-07-08 04:18:23 UTC
happens to me as well on large heap dumps. Clicking the hyperlink to show stacktraces effectively halts the IDE, I get more or less similar stactrace as jglick.

Product Version: NetBeans IDE Dev (Build 201406290002)
Java: 1.7.0_60; Java HotSpot(TM) 64-Bit Server VM 24.60-b09
Runtime: Java(TM) SE Runtime Environment 1.7.0_60-b19
System: Mac OS X version 10.9.4 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/mkleint/Library/Application Support/NetBeans/dev
Cache directory: /Users/mkleint/Library/Caches/NetBeans/dev
Comment 6 Tomas Hurka 2014-07-24 06:37:08 UTC
Fixed in profiler-main

changeset:   275889:6f39ee343f8a
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Jul 24 08:35:19 2014 +0200
summary:     bugfix #172681, cache results of HTMLDocument.getText() and enable 'mutliByte' property to use faster BreakIterator

changeset:   275888:76a18a86bdee
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Jul 24 08:26:48 2014 +0200
summary:     bugfix #172681, use spaces instead of tabs to format the text
Comment 7 Quality Engineering 2014-07-25 02:36:04 UTC
Integrated into 'main-silver', will be available in build *201407250001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/76a18a86bdee
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #172681, use spaces instead of tabs to format the text