Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316637

Summary: Very High CPU Usage in PHP (PDT) with large code base.
Product: z_Archived Reporter: neilljones
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: ganoro, silviya, sowingsadness, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description neilljones CLA 2010-06-11 13:30:57 EDT
Build Identifier: Build id: M20100211-1343

I have a problem with very high CPU usage while using Aptana 2.0.4.1268158907 on Mandriva 2010 while editing PHP files using the PHP plugin (PDT). My project has around 8000 files and while typing CPU usage goes up to 185% (two cpus) and stays there for many minutes.

I've managed to trace the cause to the "report problems as you write" option. If I go to General->Editors->structured text in the preferences and turn off "report problems as you write" my CPU usage drops to about 18% and falls again quickly instead of the 180% (2 cpus) falling again after minutes.

Unfortunately this has the totally unwanted side-effect of turning off the code assist (at least it never pops up now). So I think the problem may well be in the code assist code too.

In other words, I'm guessing there is an inefficient function that checks what you are typing and decides what to pop up that hits limits when there are too many files to consider.

After discussing this on the Aptana forum it was felt this bug is in the PDT and certainly by removing PDT and using the Aptana 1.1 PHP editor, the problem (and the "report problems as you write" button) disappears.

The project I'm working on has around 8000 files so not that large, but not small either. The machine is not the newest so I expect I am hitting system limits with less files than other people might. However it is a very consistent problem.

I'm not after a solution here as I'm going to use the Aptana plugin for the moment, but it's obviously something that will need to be addressed for PDT.

If you can't replicate it, profiling what methods are called as you type may reveal where the culprit is hiding.

Neill

Reproducible: Always

Steps to Reproduce:
1. Build up a project with 8-10,000 php files of large size and complexity
2. Make sure "report problems as you type" is on
3. Watch the CPU usage sky-rocket as you type. It calms down again afterwards.

If 1. doesn't work your system may not be hitting limits. So instead trace through to find out what functions are getting called as you type and profile them to see which one(s) are spending ages checking all the code.
Comment 1 Kir CLA 2010-07-07 11:23:08 EDT
Maybe it's same bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=315337

Try to off all checkbox "Enabled" in code coloring for each "Syntax element" and problem must disappear.
Comment 2 Dawid Pakula CLA 2014-10-01 20:40:41 EDT
PDT 3.3 resolves most problems.
Comment 3 Sylvia Tancheva CLA 2015-05-21 05:28:16 EDT
Closing. Please reopen if still relevant