Gedit uses 100% of the CPU while editing files

Bug #367372 reported by Nicklas W Bjurman on 2009-04-26
92
This bug affects 19 people
Affects Status Importance Assigned to Milestone
gedit
New
Medium
gedit (Ubuntu)
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gedit

Making changes to a file(typing or deleting characters) makes gedit consume 100% of the CPU power available.
I noticed this since I've installed Ubuntu 9.04.

I was poking in the fonts setting under the appearance preferences and I thought I noticed a slight difference if I turn off all processing and make the font glyph render without subpixel rendering and hinting. However it is merely marginal. To make sure it was not the graphics drivers I switched from the ati drivers to vesa but that did not help at all.

I am running on a 5 years old Dell Inspiron 5100 laptop with Radeon Mobility 7500(details in lspci-vvnn.log provided in link below), with 256MiB of RAM.
http://launchpadlibrarian.net/21840367/dmesg.log
http://launchpadlibrarian.net/21840491/lspci-vvnn.log

uname -a yields:
Linux lordmetroid-laptop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

description: updated
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please try to obtain a backtrace following the instructions at http://wiki.ubuntu.com/DebuggingProgramCrash and upload the backtrace (as an attachment) to the bug report. This will greatly help us in tracking down your problem.

Changed in gedit (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Low
status: New → Incomplete
Sebastien Bacher (seb128) wrote :

do you get the same issue using a stock user configuration?

Nicklas W Bjurman (lordmetroid) wrote :

I get the same problem whatever configuration I have tried, whether it be the default configuration from the box installation nor the configurations with vesa drivers, all text rendering post-processing turned off, plugins turned off, it doesn't seem to matter.

Nicklas W Bjurman (lordmetroid) wrote :

I don't think this is really useful at all.
The strange thing though is that gedit didn't consume 100% of the CPU while I ran it and traced it...

Nicklas W Bjurman (lordmetroid) wrote :

I don't know if this is relevant but for some reason I haven't noticed it as of lately.

Changed in gedit (Ubuntu):
status: Incomplete → New
Sebastien Bacher (seb128) wrote :

does anybody still get it in jaunty?

Changed in gedit (Ubuntu):
status: New → Incomplete
Nicklas W Bjurman (lordmetroid) wrote :

Yes, I still get it!
I have tried to isolate the problem, the cpu hogging occurs whether gedit is the only running application launched by me personally or not. I am not using any font hintning, and only font grayscale smoothing, all visual effects turned off.

The cpu hogging is dependant on what file I am editing and where in the file. The hogging occurs writing anything between line 1 and line 12, writing anything on any other line seemingly works fine.

In the follwing two screenshots, I am in progress of writing the if statement on line 3.

Nicklas W Bjurman (lordmetroid) wrote :
Changed in gedit (Ubuntu):
status: Incomplete → New
Nicklas W Bjurman (lordmetroid) wrote :
Changed in gedit:
importance: Undecided → Unknown
status: New → Unknown
Changed in gedit:
status: Unknown → New
Changed in gedit (Ubuntu):
status: New → Triaged
riclees (scottishplayerguy) wrote :

I've also began experiencing this problem (100% of CPU consumed), though it is from startup and not necessarily to do with paragraph length.

However I've noticed that if I run 'sudo gedit' rather than from my usual username, it is fine.

This has happened fairly randomly (no updates applied)

Martin Koelewijn (vcoolio) wrote :

Same issue on ubuntu karmic i686, updated (gedit 2.28.0-0ubuntu2). On gedit start, 100% cpu. gksudo gedit works fine. Removing ~/.gnome2/gedit doesn't help, neither does reinstalling gedit. No files opened. Gdb-output attached; if you need more info, let me know.

Changed in gedit:
importance: Unknown → Medium
naphelge (naphelge) wrote :

I just started experiencing this issue today, for whatever reason. Updates a couple of days ago, but I use Gedit many times during the course of a day for html and writing papers/journal and so everything was working fine after last update.

I have opened and edited files I am experiencing trouble with using both mousepad and kate and no problem at all. I also tried the gksu suggestion and gedit works tickity boo that way.

So is there a solution for this problem? Like I said I use Gedit daily, and some days non-stop, so this bugs is a major PITA and near impossible to work with.

Any suggestions will be appreciated tried ASAP

BTW... if it matters I am running xubu 10.04

cheers

thedoctar (thedoctar) wrote :

I too, have just encountered this problem. I ran [code] thedoctar@GALLIFREY ~ $ top -d 1 -n 10 -p 8710 -b > ./gedit-cpu-usage [/code], attached is the output.

thedoctar (thedoctar) wrote :

Sorry for double posting/commenting, not sure how to edit the comment above. The CPU usage spikes when I hold down the 'f' key, and the gedit screen doesn't show the 'f's being written until i let go.

Timothy Arceri (t-fridey) wrote :

@The Doctor: Can you please provide a list of the plugins you have activated and also the version of Gedit you are using?

thedoctar (thedoctar) wrote :

Actually, I managed to fix it by deleting (not just unchecking in the plugin list) many plugins I wasn't using (I had downloaded the plugins package for gedit). Sorry, I didn't record which plugins I had activated, although I only fixed the problem, as I've said above, by deleting the plugins. Hopefully this helps. I'm using version 2.30.4

Mysha (mysha) wrote :

I'm on Lynx, running gedit 2.30.3. I started getting this problem a few weeks ago. I got rid of it somehow but it's back now.

Seeing the direction on this report page, I started testing the plug-ins. I had reinstalled gedit and probably dropped all extra plug-ins in the process. Switching off the plug-ins one after another, I found all would switch off easily, except for Bestandsverkennerspaneel, which took a long time to switch off. I don't know the English name (the plug-in info doesn't show a "standard name"), but the name translates to something like "File Explorer Panel".

Figuring that this was something file related, I started saving files from gedit with new names, exiting and launching in between. For the first five, I had not changes. The sixth file I did by launching from the shell with a new filename. At that point the processor usage dropped back to normal.

Considering this is file-exploring related, I wonder whether the fact that I'm editing files in multiple fifty thousand file directories might be causing problems. I've been editing files from a single such directory for years, but it's recent that I've had multiple such directories, and it's from that same time that I'm writing files back to overwrite files in such copies. I'm not saying that this is definitely the cause, but it might be worth having a look at.

I'll leave that plug-in switched of for now, but feel free to ask me to test.

Stan Williams (stanwmusic) wrote :

Gedit started using excessive CPU Only since I upgraded to Trusty, 14.04.
I am using LUBUNTU but use Gedit,and i have use it for years on Lububtu,with no problem, but now, the CPU runs away,
but If I hit Ctrl + S or save it calms down, I am on an older Dell GX280 and when I edit in Gedit the fan begins to go really fast, as soon as I type or paste a character or line, but as soon as I save it, the CPU usage slows down to at least better , right now it is using about 12% CPU , but, I can close Gedit and it drops to 0 to 1 % CPU usage, on average.
I was using Gedit on 13.10 with NO problems until I upgraded this box to Trusty.

I hope this is the right place to comment, if not, please delete this (admins).
I will keep searching to see if anyone else has had a similar experience since upgrading to 14.04.

Jack De Waele (rocksam) wrote :

I'm on Trusty and just got this same issue with gedit, 95%CPU and slow/no response to typing. This is the first time I got this. I noticed that it only occured when I open gedit via the launcher to create a new document. I then opened gedit by double-clicking an existing textfile and it opened without problem, no heavy CPU load, good response, even for a new empty file. After closing gedit and start via the launcher everything was OK again. But this makes it impossible for me to reproduce the issue and investigate some more.

Per (perguth) wrote :

I experience this with Ubuntu 14.10. Also the mouse pointer sporadically becomes invisible/blinks when over the Gedit window.

Ben Parmeter (nebhead77) wrote :

Just installed a fresh install of 14.10 two days ago and I am experiencing exactly the same thing as user pguth is describing as well. I really don't have anything else installed, except for the nVidia graphics drivers, chrome, and steam.

Mark Cocker (mark-earth) wrote :

I am seeing this issue on a new install of Ubuntu 14.10 64-bit with NVIDIA driver 331.89.

I get about 50% CPU on 8 cores just just editing a new (unsaved) text document. If I give focus to another window the CPU drops and the mouse correctly shows, and I can then go back to gedit and things are fine for a minute or so then CPU spikes again.

I do not see this issue with any other application.

Salvatore (spicer150) wrote :

[My SOLUTION]
in my lubuntu 14.04 same problem. Googling I found 100%cpu utilisation is due to the two processes: ibus-daemon and ibus-x11

1st SOLUTION: start menu > Preferences > Language Support > Keyboard Input Method System: none

2n alternate SOLUTION: sudo apt-get remove ibus

NOTE:
IBUS is an "alternative" to setxkbmap
IBUS has many problem with some keyboard under lubuntu 14.04
see also (ibus daemon cpu use flares up briefly when editing in Gedit) at https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/1299759

Thanks Salvatore.

I had the same problem (gedit hangs and mouse disappears) on a freshly installed Ubuntu 14.10, but without reaching 100% cpu utilization. Disabling ibus as you suggested solved the problem; not only in gedit, but also in a few other applications as well.

Changed in gedit (Ubuntu):
status: Triaged → In Progress
status: In Progress → Confirmed
Fauzan Azzam (goghor) wrote :

Salvatore solutions worked for Me, thank you!

juanjofm (juanjofornesmari) wrote :

I bought a new laptop, installed 14.04 and it works fine, 14.10 I see this problem. I think it's ibus... I will try that workaround.

Marc Brevoort (kleinebre) wrote :

100% CPU use by gedit is still an issue in 2016 (nearly 7 years now).

Making any selection with the keyboard (e.g. selecting a line with shift-arrow down) triggers 100% cpu usage. Selecting a text with the mouse leaves the CPU alone.

As soon as I hit ctrl-S or open the file menu with the mouse, CPU usage drops again.

Marc Brevoort (kleinebre) wrote :

By the way that's gedit 3.10.4 on Ubuntu 14.04. I haven't removed ibus as this threatens to delete a whole bunch of other stuff as well - I'm not risking it.

Marc, you don't need to remove the package ibus, just disable it as suggested by Salvatore: start menu > Preferences > Language Support > Keyboard Input Method System: none.

That worked fine for me

Yes, this annoy me too. Disgusted.

Forgot: Ubuntu 15.10

Solution: menu > Preferences > Language Support > Keyboard Input Method System: none
i.e. swith from "ibus" to "none"

Sorry for duplicate solution. I have red eyes full of hate.

Steven Roose (stevenroose) wrote :

No "Language Support" section in my settings...

Oleh Sliusar (olehsliusar) wrote :

It happens when I open /var/log/syslog
It might be due to large text file.

Chris Katko (ckatko) wrote :

This explodes on Gedit any time I try to edit a file with sudo under the /etc/ directory. The entire computer freezes as CPU load average hits over 4.

gedit --version

3.28.1

uname -a

Linux _ 4.10.0-041000-generic #201702191831 SMP Sun Feb 19 23:33:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

simple way to reproduce:

sudo gedit /etc/hosts

enjoy your computer freezing. To the point even htop can't update except once every 10 seconds. (Note: My hosts file is almost default and maybe 20 lines long including comments. This is NOT a big file.)

ibus-x11
  and
ibus/ui-gtk3

both go wide open with CPU usage.

After ~5 minutes, if you leave it alone, Gedit will then explode and all text turns into squares (ala font glyph not found).

Soon after that, it'll crash, and Ubuntu will say "system program problem detected".

In the terminal window, I got the following output upon crash:

sudo gedit /etc/hosts

(gedit:5521): Pango-WARNING **: 00:28:01.739: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans 11'

(gedit:5521): Pango-WARNING **: 00:28:01.748: font_face status is: out of memory

(gedit:5521): Pango-WARNING **: 00:28:01.748: scaled_font status is: out of memory

(gedit:5521): Pango-WARNING **: 00:28:01.748: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='DejaVu Sans 11', text='●'

(gedit:5521): Pango-WARNING **: 00:28:01.763: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans Bold 11'

(gedit:5521): Pango-WARNING **: 00:28:01.763: font_face status is: out of memory

(gedit:5521): Pango-WARNING **: 00:28:01.763: scaled_font status is: out of memory

(gedit:5521): Pango-WARNING **: 00:28:01.763: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='DejaVu Sans Bold 11', text='hosts'

(gedit:5521): Pango-WARNING **: 00:28:01.768: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans 9.1669921875'

(gedit:5521): Pango-WARNING **: 00:28:01.772: font_face status is: <unknown error status>

(gedit:5521): Pango-WARNING **: 00:28:01.772: scaled_font status is: out of memory

(gedit:5521): Pango-WARNING **: 00:28:01.772: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='DejaVu Sans 9.1669921875', text='/etc'
Fontconfig error: Cannot load default config file

(gedit:5521): Gtk-WARNING **: 00:29:07.962: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Humanity/status/16/image-missing.svg: Error opening file /usr/share/icons/Humanity/status/16/image-missing.svg: Too many open files (g-io-error-quark, 31)
Aborted

Chris Katko (ckatko) wrote :

I went into keyboard settings and disabled ibus. But it still occurs.

Looks like WebKitWebProcess 4 40 (attached to this process) is wide open CPU too.

also something called

yelp: help gedit

it hasn't crashed yet with ibus disabled but... OH MY GOD. WebKitWebProcess has 82.2 GB of virtual memory! Looks like someone's creating memory without clearing it!

Chris Katko (ckatko) wrote :

gedit took longer, but it's now showing square text symbols and reported this on command line (but hasn't been terminated yet):

Fontconfig error: Cannot load default config file

(yelp:6780): Pango-WARNING **: 00:51:46.064: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans 11'

(yelp:6780): Pango-WARNING **: 00:51:46.064: font_face status is: out of memory

(yelp:6780): Pango-WARNING **: 00:51:46.064: scaled_font status is: out of memory

(yelp:6780): Pango-WARNING **: 00:51:46.064: shaping failure, expect ugly output. shape-engine='PangoFcShapeEngine', font='DejaVu Sans 11', text='●'
Failed to get the memory usage
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file
Failed to create shared memory: Too many open files

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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