#95 OutOfMemoryError for larg sql file (syntax highlighting?)

open
nobody
None
5
2012-05-14
2012-05-14
Thomas Meyer
No

SQLExplorer crashes with java.lang.OutOfMemoryError: Java heap space because of Syntax highlighthing in slightly larger files.
I wanted to open a file with around 40.000 SQL insert statements. When I open the same file with the normal Eclipse text editor I don't get any problems, but when I open the same file with the SQL Editor I get this stack trace:
java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(Unknown Source)
at org.eclipse.jface.text.TextViewer.applyTextPresentation(TextViewer.java:4824)
at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4888)
at org.eclipse.jface.text.presentation.PresentationReconciler.applyTextRegionCollection(PresentationReconciler.java:579)
at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:568)
at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:564)
at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.inputDocumentChanged(PresentationReconciler.java:119)
at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2888)
at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2937)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:640)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:574)
at net.sourceforge.sqlexplorer.sqleditor.SQLTextViewer.setDocument(SQLTextViewer.java:184)
at net.sourceforge.sqlexplorer.sqleditor.SQLTextViewer.setDocument(SQLTextViewer.java:204)
at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:4030)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3558)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
at net.sourceforge.sqlexplorer.plugin.editors.SQLTextEditor.createPartControl(SQLTextEditor.java:131)
at net.sourceforge.sqlexplorer.plugin.editors.SQLEditor.createEditor(SQLEditor.java:339)
at net.sourceforge.sqlexplorer.plugin.editors.SQLEditor.createPartControl(SQLEditor.java:242)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)

SQLExplore should disable syntax highlighting for files of a given size.

SQLExplore version is:

Discussion