gedit leaks memory

Bug #305927 reported by Stefano Angeleri
This bug affects 11 people
Affects Status Importance Assigned to Milestone
gedit (Ubuntu)

Bug Description

Binary package hint: gedit

It seems gedit doesn't release the memory used to open a file when closing it making it so use ridiculous space in ram for little files if you opened a big file and closed it. Strangely gnome system monitor reports a lower memory use under the processes tab, but reports the used ram in the resources tab and top actually gives the high amounts of used ram.

To try this:
1- open gedit
2- open top
3- notice the ram use: 19393 weltall 20 0 38980 19m 10m S 0 0.7 0:00.79 gedit
4- get a big file to open (mysql dumps are the best to try. I've tried with a ~50 mb dump)
5- you will notice an higher ram use, for sure > 300mb to open a 50mb file is a bit excessive but this is still an optimization issue which goes beyond this bug report: 19393 weltall 20 0 342m 305m 12m S 2 10.1 3:02.14 gedit
6- close the tab which had the file
7- check again top no changes in ram use: 19393 weltall 20 0 342m 305m 12m S 0 10.1 3:02.85 gedit
this is definitely a memory leak or a bad ram retaining for future use implementation
8- try to reopen the file, gedit will take the same time to parse the file, but the increase of ram use is more little: 19393 weltall 20 0 381m 345m 12m S 0 11.4 6:01.23 gedit
9- close the file again the ram use doesn't change again

other gnome applications have similar leak issues like nautilus which after some days takes more than 300mb like nothing and closing windows doesn't release ram so maybe the problem might reside in underlying libraries.

It seems applications like geany actually releases correctly the ram but i didn't investigate if they use similar libraries

i'm using ubuntu intrepid with all the updates from normal repositories (altough this bug has been present since various releases)
Description: Ubuntu 8.10
Release: 8.10

  Installed: 2.24.2-0ubuntu1
  Candidate: 2.24.2-0ubuntu1
  Version table:
 *** 2.24.2-0ubuntu1 0
        500 intrepid-updates/main Packages
        100 /var/lib/dpkg/status
     2.24.0-0ubuntu1 0
        500 intrepid/main Packages

Tags: intrepid
description: updated
description: updated
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please try to obtain a valgrind log following the instructions at and attach the file to the bug report. This will greatly help us in tracking down your problem.

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Stefano Angeleri (weltall) wrote :

This is by opening a 7mb file (this time) two times

Revision history for this message
Stefano Angeleri (weltall) wrote :

and this is by opening the same file only one time and then closing it (while the previous one was opening closing opening closing)

Changed in gedit:
status: Incomplete → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

those logs have no real leaks, should be sent to by somebody having the issue though

Revision history for this message
Pedro Villavicencio (pedro) wrote :

did you sent it upstream ? may you tell us the bug number or should we close this report?

Revision history for this message
Stefano Angeleri (weltall) wrote :

yes i've sent it upstream this is the bug number 568558

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for sending the bug to GNOME

Changed in gedit:
status: New → Triaged
Changed in gedit:
status: Unknown → New
Revision history for this message
A. Bram Neijt (bneijt) wrote :

I've got a git checkout and rand valgrind, the leaks that are definite according to valgrind:
libio (from glib)
launchpadintegration bug #483610
glibc nns (g_option_context_parse)
libfontconfig in a call of FcConfigParseAndLoad XML_ParseBuffer
from g_type_create_instance into fontconfig
g_object_newv into fontconfig

It seems like there is a leak in pango, libio and launchpadintegration and gedit using them all to leak as fast as it can :)

Revision history for this message
Mark (spudone) wrote :

Note that the memory usage appears related to the text highlighting.

I loaded a moderately large (~100MB) XML file. Once the initial load finishes, CPU usage stays high while highlighting is proceeding. Memory usage skyrockets during this time (in my case, eventually hitting 1.2GB resident). Closing the file does not free the memory.

Changed in gedit:
importance: Unknown → Critical
Changed in gedit:
status: New → Confirmed
Revision history for this message
madbiologist (me-again) wrote :

Does this still occur on Ubuntu 18.10 "Cosmic Cuttlefish" with gedit 3.30.2-0ubuntu0.18.10.2?

Several memory leaks were fixed in gedit 3.14.0-3.

Changed in gedit (Ubuntu):
status: Triaged → Incomplete
madbiologist (me-again)
tags: added: intrepid
Revision history for this message
Paul White (paulw2u) wrote :

Bug report did not close due to bug watch
Initial reports were about GNOME 2 version of gedit
Upstream issue closed "RESOLVED OBSOLETE" on 2020-11-24
No reply to comment #10 after almost 4 years so closing

Changed in gedit (Ubuntu):
status: Incomplete → Invalid
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.