1

I built an editor part in eclipse to visualize a Zest graph. My problem: if I try to close an editor part which contains a big graph (~6000 nodes, 9000 edges), eclipse can't handle the closing operation and hangs up.

Any ideas to solve the problem or debug it?

I think the problem is to dispose the graph object, but I have not idea to solve it.

Thanks in advance!

Yannic
  • 15
  • 3

2 Answers2

0

To debug it, I'd try to look into the Eclipse log file (workspace/.metadata/.log) for clues on what happened. It might be some memory issue. If it sounds like that form the log file, you could try to alter your eclipse.ini config, in particular the -XX:MaxPermSize, -Xms, and -Xmx values (see http://wiki.eclipse.org/Eclipse.ini).

If the problem persists with reasonable memory values, it would be great if you could file a bug: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GEF&component=Zest

Fabian Steeg
  • 44,988
  • 7
  • 85
  • 112
  • There's no logged information about my problem and I don't think that it's a memory problem because in this case I should get some exceptions? – Yannic Jul 01 '13 at 08:46
  • @Yannic I'd still try to set some larger memory settings and see what happens. You could also try a clean Eclipse setup, e.g. just the SDK + Zest. If it still hangs up I'd be very happy about a bug report with an SSCCE: http://sscce.org/ – Fabian Steeg Jul 01 '13 at 08:57
  • I made some simple examples with 7000 nodes and 10,000 edges. My results: closing one graph with 7000 nodes and 10,000 edges is no problem. Closing a Graph object with 10 subgraphs is a problem. Can you explain which methods are called when the user closes an editor in which a Graph object is contained? I tried to build a new class "ExtendedGraph" which extends the Graph class and overrides the dispose method to log the calls of this method. But there is no call... – Yannic Jul 04 '13 at 14:26
  • @Yannic Interesting, so it's a subgraph issue - could you file a bug with a sample snippet to reproduce this at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GEF&component=Zest – Fabian Steeg Jul 05 '13 at 15:42
  • I checked out the repository and debugged the code. The exact problem is the method: org.eclipse.gef4.zest.layouts.algorithms.TreeLayoutObserver.TreeNode.isAncestorOf(TreeNode descendant) I'm going to fix the problem because I can't wait for an official bug fix. – Yannic Jul 06 '13 at 10:02
0

The problem was the method "org.eclipse.gef4.zest.layouts.algorithms.TreeLayoutObserver.TreeNode.isAncestorO‌​f(TreeNode descendant)". I fixed it for me and I will report a bug (for bug id show in the comments). If someone needs a quick bug fix:

old version:

    public boolean isAncestorOf(TreeNode descendant) {
        while (descendant.depth > this.depth) {
            descendant = descendant.parent;
        }
        return descendant == this;
    }

new version:

    public boolean isAncestorOf(TreeNode descendant) {
        while (descendant.depth > this.depth) {
            if (descendant == descendant.parent) {
                return false;
            } else {
                descendant = descendant.parent;
            }
        }
        return descendant == this;
    }
Yannic
  • 15
  • 3