Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313462 - High CPU Utilization while working with "Linux Workspace"
Summary: High CPU Utilization while working with "Linux Workspace"
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 01:58 EDT by Chirag Singla CLA
Modified: 2016-10-18 15:42 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot of high CPU consumption observed while running top command (135.44 KB, application/octet-stream)
2010-05-19 02:00 EDT, Chirag Singla CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chirag Singla CLA 2010-05-19 01:58:15 EDT
Build Identifier: M20090211-1700

STR:
1) Create an Eclipse Plug-in say Hello, World Plug-in Eclipse.
2) Insert a delay.(This delay should be long enough to allow the user to switch from one "Linux workspace say workspace 0 where Eclipse is running" to another "Linux Workspace say workspace 1" without the "Hello, Eclipse World" MessageDialog popping up).
3) On the "workspace 1" run top command. You will notice high CPU utilization a
round 90-99%.
4) If I come back to "workspace 0" then this high CPU utilization goes down.

Example of run function from sample Action in Hello, World Plug-in:

	"public void run(IAction action) {
		for(int i =0;i<1000;i++){
			for(int j=0;j<1000;j++){
				for(int k=0;k<1000;k++){
					
				}
			}
		}
		
		MessageDialog.openInformation(
			window.getShell(),
			"HelloWorld Plug-in",
			"Hello, Eclipse world");
	}"

Scenario/Use case where this impact will be seen:
Suppose I am doing some heavy operation say, checkin a set of files in the SVN repository. I pop out a dialog which shows the status of which files got checked in or not. Now this check-in opeation and subsequent results generation in Dialog will take some time. While the check-in operation is going on a user may switch to other Linux Workspace say "Workspace 1". If a user forgets to come back to original workspace, he will notice high CPU consumption for the Dialog which is just waiting for "Ok click".

Reproducible: Always

Steps to Reproduce:
1.Create an Eclipse Plug-in say Hello, World Plug-in Eclipse.
2.Insert a delay.(This delay should be long enough to allow the user to switch from one "Linux workspace say workspace 0 where Eclipse is running" to another "Linux Workspace say workspace 1" without the "Hello, Eclipse World" MessageDialog popping up).
3.  On the "workspace 1" run top command. You will notice high CPU utilization a
round 90-99%.
4. If I come back to "workspace 0" then this high CPU utilization goes down.
Comment 1 Chirag Singla CLA 2010-05-19 02:00:29 EDT
Created attachment 169050 [details]
Screenshot of high CPU consumption observed while running top command
Comment 2 Praveen CLA 2010-05-20 08:34:21 EDT
I am unable to reproduce this on Ubuntu9.04 and 3.6RC1. As soon as the delay/loop finishes, the CPU load by Eclipse comes down to normal. I didn't see any consistent CPU utilization by Eclipse just for message dialog prompt.

Which version of GTK you are using ? Is the problem reproducible for you on latest version of 3.6 builds as well ?
Comment 3 Chirag Singla CLA 2010-05-21 02:37:37 EDT
I have checked with Eclipse 3.4.2 and Eclipse 3.5 builds on Open Suse 11. The issue is reproducible always. 
I have also checked with Red Had Enterprise Server Version 5.3. The issue is reproducible with Red Hat too. 

Alternative Steps to reproduce:
1) Launch Eclipse (say by double clicking on the Desktop icon).
2) Do not wait for the choose workspace dialog for Eclipse to come up. Switch to another Linux Workspace immediately.(Caution: If you wait for the dialog to come up then you will not be able to reproduce this issue). 
Now your Linux workspace 0  has Eclipse running and Linux workspace 1 had top command running and you are in Linux workspace 1. Do not switch back to workspace 0. Observe the results of top command in Linux Workspace 1 for 2-5 minutes, without switching to workspace 0. You will notice high CPU utilization consistently of 90-99%. 
Another Observation: If you move back to workspace 0, then the CPU utilization comes down immediately(you do not have to wait to click ok).

Problem: If I forget to move to "Linux Workspace 0", then for no reason there will be high CPU consumption by the Eclipse and my applications on the other "linux workspaces" will be affected.
Comment 4 Praveen CLA 2010-05-21 09:23:46 EDT
It seems the problem is specific to a few Linux distributions. I tried following your steps, but I could not recreate the problem.
While I am at workspace-1, when a popup dialog appears on workspace-0, Ubuntu displays the dialog on workspace-1 itself and thus, CPU load falls down immediately. So, the CPU load pumps up only for a moment.
Comment 5 Chirag Singla CLA 2010-05-21 10:22:36 EDT
Do you have a large number of windows open in workspace-0? I noticed the behavior, similar to "when a popup dialog appears on workspace-0, displayed in workspace-1" when a large number of windows are open in workspace-0 for OpenSuse. If you do not have large number of windows open in workspace-0, then the dialog opens in the workspace-0. I am not sure about the behavior with Ubuntu though...
Comment 6 Eric Williams CLA 2016-10-18 15:42:12 EDT
Without a snippet reproducer this issue is hard to pin down. Using the steps mentioned, I do not see any high CPU usage.