Bug 57440 - OutOfMemoryError after introduction of JSyntaxTextArea in LoggerPanel due to disableUndo not being taken into account
Summary: OutOfMemoryError after introduction of JSyntaxTextArea in LoggerPanel due to ...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.12
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
: 57716 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-13 21:19 UTC by UbikLoadPack support
Modified: 2015-03-16 19:57 UTC (History)
2 users (show)



Attachments
Test Plan to reproduce bug (5.39 KB, application/xml)
2015-01-24 15:46 UTC, Philippe Mouawad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description UbikLoadPack support 2015-01-13 21:19:00 UTC
Hello,
We had an OOM that we analyzed.
I appears that there is a memory leak in LoggerPanel due to JSyntaxtTextArea#UndoManager. It seems no limit is set on it.

Although code overrides createUndoManager to disable Undo it is not working:
    /**
     * Override UndoManager to allow disabling if feature causes issues
     * See https://github.com/bobbylight/RSyntaxTextArea/issues/19
     */
    @Override
    protected RUndoManager createUndoManager() {
        RUndoManager undoManager = super.createUndoManager();
        if(disableUndo) {
            undoManager.setLimit(0);
        } else {
            undoManager.setLimit(MAX_UNDOS);
        }
        return undoManager;
    }
And LoggerPanel does this:
textArea = new JSyntaxTextArea(15, 80, true);
Meaning it disables UndoManager it is not working.
In the case of LoggerPanel it's a big issue as any edition will trigger a lot UndoEdit with a lot of content.

Analyzing issue it is due to createUndoManager being called before disableUndo is set in constructor.

Workaround for 2.12 and don't open LoggerPanel:
jmeter.loggerpanel.enable_when_closed=false

Regards
@ubikloadpack
Comment 1 Philippe Mouawad 2015-01-13 21:46:31 UTC
Hi,
See last comment in:
https://github.com/bobbylight/RSyntaxTextArea/issues/19
Comment 2 Philippe Mouawad 2015-01-13 21:54:53 UTC
Issue also affects 2.11
Comment 3 Philippe Mouawad 2015-01-13 22:13:15 UTC
Date: Tue Jan 13 22:12:57 2015
New Revision: 1651516

URL: http://svn.apache.org/r1651516
Log:
Bug 57440 - OutOfMemoryError after introduction of JSyntaxTextArea in LoggerPanel due to disableUndo not being taken into account
Bugzilla Id: 57440

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
    jmeter/trunk/xdocs/changes.xml
Comment 4 Philippe Mouawad 2015-01-23 08:12:21 UTC
Reopening as issue persists even with fix.
See :
https://github.com/bobbylight/RSyntaxTextArea/issues/99
Comment 5 Philippe Mouawad 2015-01-24 15:19:30 UTC
Date: Sat Jan 24 15:18:31 2015
New Revision: 1654539

URL: http://svn.apache.org/r1654539
Log:
Bug 57440 - OutOfMemoryError after introduction of JSyntaxTextArea in LoggerPanel due to disableUndo not being taken into account
Bugzilla Id: 57440

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/LoggerPanel.java
Comment 6 Philippe Mouawad 2015-01-24 15:46:46 UTC
Created attachment 32394 [details]
Test Plan to reproduce bug

Hi,
To reproduce open in GUI mode this plan and run it.
It will throw exception, with default 2.12 bundle, OOM will occurs in few seconds.

Regards
Philippe
Comment 7 Philippe Mouawad 2015-03-16 19:57:39 UTC
*** Bug 57716 has been marked as a duplicate of this bug. ***
Comment 8 The ASF infrastructure team 2022-09-24 20:37:58 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3514