Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] JGit - constant 100% CPU usage in MyersDiff

On Fri, Nov 12, 2010 at 8:36 AM, Zivkov, Sasa <sasa.zivkov@xxxxxxx> wrote:
> On our internal Gerrit system I found out that Gerrit process is constantly using 100% of CPU.
> Using Gerrit 2.1.5.
>
> Using "top -H" and creating several thread dumps I found that the java thread that is
> consuming the CPU is always doing something in MyersDiff class.
...
> It is already more than an hour since the first thread dump and the CPU usage is still 100%
> and the top -H shows the same thread at the top.
>
> Looks like an infinite loop somewhere in MyersDiff?

Yes.  :-(

I've tried to debug this and failed, horribly.  I only see it on
certain text files when Gerrit is using MyersDiff to get a
character-by-character difference for the intraline difference
coloring it displays.  The fact that I couldn't grok the code well
enough to understand how we were looping (and how hard it is to find a
case that does this) is one of the things that led me to write
PatienceDiff and eventually HistogramDiff for JGit.  Unfortunately
these don't work well for character-by-character differences as there
aren't enough unique points to pick for the LCS on each iteration,
which means they still need to fall back on MyersDiff.

-- 
Shawn.


Back to the top