Fast Screen Output In Terminal Slows Down Gnome

Asked by Dustin Oprea

If I dump a large amount of data to STDOUT in gnome-terminal, the gnome-terminal seems to jam the system with 100% CPU utilization (user interaction dies, and everything else grinds to a halt). When first executed, it pauses before any output (an indication that the terminal is about to produce a massive slowdown), and then starts the dump (such as a large SQL file, log file, or just a large amount of program output). It looks like the data only has be a few pages long. If you try to interrupt execution via CTRL+BREAK, it might take a while to activate. System activity and interaction promptly returns to normal upon completion.

This is the first time that I have ever experienced this in all of the years I've been using Ubuntu. I'm running a system that was originally Mint 11 Katya, but has since been converted to Ubuntu (11.04 Natty).

This is a PHP script that may be used for testing:

    <?php
    $n = 0;
    while($n < 10000000)
    {

        $randChar = rand(ord('a'), ord('z'));
        print(chr($randChar));

        $n++;
    }

Package version:

    gnome-terminal:
      Installed: 2.32.1-0ubuntu3
      Candidate: 2.32.1-0ubuntu3
      Version table:
     *** 2.32.1-0ubuntu3 0
            500 http://archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
            100 /var/lib/dpkg/status

Konsole seems to work perfectly. I heard something about this possibly being a GTK problem. Is there a cure?

Dustin

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dustin Oprea (myselfasunder) said :
#1

I was notified that there was a change on this ticket. I do not see what was
changed, though.

Thanks.

Dustin

On Tue, Oct 18, 2011 at 11:15 PM, marcobra (Marco Braida) <
<email address hidden>> wrote:

> Your question #175150 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/175150
>
> Description changed to:
> If I dump a large amount of data to STDOUT in gnome-terminal, the gnome-
> terminal seems to jam the system with 100% CPU utilization (user
> interaction dies, and everything else grinds to a halt). When first
> executed, it pauses before any output (an indication that the terminal
> is about to produce a massive slowdown), and then starts the dump (such
> as a large SQL file, log file, or just a large amount of program
> output). It looks like the data only has be a few pages long. If you try
> to interrupt execution via CTRL+BREAK, it might take a while to
> activate. System activity and interaction promptly returns to normal
> upon completion.
>
> This is the first time that I have ever experienced this in all of the
> years I've been using Ubuntu. I'm running a system that was originally
> Mint 11 Katya, but has since been converted to Ubuntu (11.04 Natty).
>
> This is a PHP script that may be used for testing:
>
> <?php
> $n = 0;
> while($n < 10000000)
> {
>
> $randChar = rand(ord('a'), ord('z'));
> print(chr($randChar));
>
> $n++;
> }
>
> Package version:
>
> gnome-terminal:
> Installed: 2.32.1-0ubuntu3
> Candidate: 2.32.1-0ubuntu3
> Version table:
> *** 2.32.1-0ubuntu3 0
> 500 http://archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
> 100 /var/lib/dpkg/status
>
> Konsole seems to work perfectly. I heard something about this possibly
> being a GTK problem. Is there a cure?
>
> Dustin
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
delance (olivier-delance) said :
#2

Probably assigned to right packet!
Personally, your issue looks more like a bug that a usage question.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#3

Indeed. I recommend reporting this as a bug. If you choose to do so, then you should first make sure to read https://help.ubuntu.com/community/ReportingBugs carefully, and search to see if this bug has already been reported.

@Dustin Oprea said:
"Is there a cure?"

You might try changing the priority of the running gnome-terminal process to a higher number (which means lower priority -- lower numbers means more priority, for example priority 1 is higher priority than priority 2). You can use the ps or (when it's using lots of CPU) top commands, or the System Monitor, to find out the PID of the running gnome-terminal process (assuming that *is* the process that's taking up the CPU, rather than the process for the program that is running *in* it, such as php). Then you can use the renice command to reduce its priority (see http://manpages.ubuntu.com/manpages/natty/en/man1/renice.1.html).

Alternatively, you can change its priority in the System Monitor itself.

@delance said:
"Personally, your issue looks more like a bug that a usage question."

Indeed. @Dustin, I recommend reporting this as a bug. If you choose to do so, then you should first make sure to read https://help.ubuntu.com/community/ReportingBugs carefully, and also search to see if this bug has already been reported. Then initiate the process of reporting the bug by triggering the problem and invoking ubuntu-bug with the PID of the process that is taking up high CPU resources.

Your bug report should be complete and self-contained, such that it is not necessary for Ubuntu developers to refer to this question in order to fully and understand and appreciate the problem. However, you should still link the bug to this question, using "Link existing bug" on this question page.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#4

[Please disregard the first paragraph of my previous post. I had relocated it to the bottom and improved it, and I neglected to delete it from the draft before submitting the post. Sorry!]

Can you help with this problem?

Provide an answer of your own, or ask Dustin Oprea for more information if necessary.

To post a message you must log in.