andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Enki leaks memory when editing html files containing javascript #436

Open vi opened 6 years ago

vi commented 6 years ago

100 edits of a html file (adding and remiving a space) => +150MB of RSS that won't go away even if I close the file. 100 more edits => +150 more megabytes...

Sometimes it grows faster.

Preview is not even visible.

100 edits of a .py or .rs file => no leak.

Sample of a file where the leak is very pronounced:

<html>
<head>
    <script>
    var AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = null;
    var AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = null;
    ... (a lot of those)
    var AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = null;
    </script>
</head>
<body>
</body>
</html>

qutepart from master: a869bf5b747de324c7881dbb1a6184cc2c7417a7

bjones1 commented 6 years ago

Ouch. I've seen some memory leaks, but haven't been able to pinpoint it. Your leaky HTML file is very helpful -- I'll see what I can find. What version of Qt are you using? What OS?

andreikop commented 6 years ago

@vi, could you please delete cParser...so, so Qutepart would not use C acceleration to highlight the code? Check if bug is reproducible without it.

vi commented 6 years ago

Debian Stretch, amd64.

libqt5gui5:
  Installed: 5.7.1+dfsg-3+b1

No cParser.so => no leak.

bjones1 commented 6 years ago

Wow. @andreikop, thanks for asking the question and @vi, for the quick answer. I was planning on spending a lot of time looking at bizarre Qt / JS stuff.

vi commented 6 years ago

What is status of this issue? (and Enki project in general)

Is it going to be fixed?

andreikop commented 6 years ago

Hi I'm not sure this issue will be fixed. Enki is not among my priorities now, and there are no other active developers

vi commented 6 years ago

Maybe then officially write on the site, on README and repo description that the project is abandoned?