Code Completion Crashes in Pydev/Eclipse

Ian Bell
2010-09-30
2013-03-15
  • Ian Bell

    Ian Bell - 2010-09-30

    Currently running Eclipse 3.5.2, and Pydev 1.6.2 on a windows XP box

    I have a class called geo which is defined in a module called plotScrolls.  When I try to reference members of the class in another file, after the class geo has been loaded, Eclipse hangs and then gives me a java heap error twice, and warns me that I should close my workspace.  I get an error to the console, the console output of which is at the bottom of this note.  Suffice to say this is super annoying since I reference members of this structure ALL the time.  Anyone have any ideas?  I found another user with a similar problem I think: http://www.mail-archive.com/pydev-users@lists.sourceforge.net/msg01304.html

    Console output:
    Java heap space
    Java heap space
    java.lang.OutOfMemoryError: Java heap space
            at java.util.Arrays.copyOf(Unknown Source)
            at java.util.Arrays.copyOf(Unknown Source)
            at java.util.ArrayList.ensureCapacity(Unknown Source)
            at java.util.ArrayList.add(Unknown Source)
            at org.python.pydev.editor.codecompletion.AbstractPyCodeCompletion.chang
    eItokenToCompletionPropostal(AbstractPyCodeCompletion.java:111)
            at org.python.pydev.editor.codecompletion.PyCodeCompletion.getCodeComple
    tionProposals(PyCodeCompletion.java:207)
            at org.python.pydev.editor.codecompletion.PythonCompletionProcessor.getP
    ythonProposals(PythonCompletionProcessor.java:228)
            at org.python.pydev.editor.codecompletion.PythonCompletionProcessor.comp
    uteCompletionProposals(PythonCompletionProcessor.java:152)
            at org.python.pydev.editor.simpleassist.SimpleAssistProcessor.computeCom
    pletionProposals(SimpleAssistProcessor.java:198)
            at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompleti
    onProposals(ContentAssistant.java:1832)
            at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeP
    roposals(CompletionProposalPopup.java:556)
            at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$1
    6(CompletionProposalPopup.java:553)
            at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(Co
    mpletionProposalPopup.java:488)
            at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)

            at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProp
    osals(CompletionProposalPopup.java:482)
            at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAs
    sistant.java:376)
            at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
            at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja
    va:134)
            at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3885)
            at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3506)
            at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
            at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
            at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
            at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
            at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.ja
    va:332)
            at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav
    a:493)
            at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
            at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEAppli
    cation.java:113)
            at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl
    e.java:194)
            at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
    cation(EclipseAppLauncher.java:110)
            at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
    lipseAppLauncher.java:79)
            at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
    va:368)

    !ENTRY org.python.pydev 4 4 2010-09-30 12:16:00.015
    !MESSAGE Java heap space
    !STACK 0
    java.lang.OutOfMemoryError: Java heap space
            at java.util.Arrays.copyOf(Unknown Source)
            at java.util.Arrays.copyOf(Unknown Source)
            at java.util.ArrayList.ensureCapacity(Unknown Source)
            at java.util.ArrayList.add(Unknown Source)
            at org.python.pydev.editor.codecompletion.AbstractPyCodeCompletion.chang
    eItokenToCompletionPropostal(AbstractPyCodeCompletion.java:111)
            at org.python.pydev.editor.codecompletion.PyCodeCompletion.getCodeComple
    tionProposals(PyCodeCompletion.java:207)
            at org.python.pydev.editor.codecompletion.PythonCompletionProcessor.getP
    ythonProposals(PythonCompletionProcessor.java:228)
            at org.python.pydev.editor.codecompletion.PythonCompletionProcessor.comp
    uteCompletionProposals(PythonCompletionProcessor.java:152)
            at org.python.pydev.editor.simpleassist.SimpleAssistProcessor.computeCom
    pletionProposals(SimpleAssistProcessor.java:198)
            at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompleti
    onProposals(ContentAssistant.java:1832)
            at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeP
    roposals(CompletionProposalPopup.java:556)
            at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$1
    6(CompletionProposalPopup.java:553)
            at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(Co
    mpletionProposalPopup.java:488)
            at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)

            at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProp
    osals(CompletionProposalPopup.java:482)
            at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAs
    sistant.java:376)
            at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
            at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.ja
    va:134)
            at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3885)
            at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3506)
            at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
            at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
            at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
            at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
            at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.ja
    va:332)
            at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav
    a:493)
            at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
            at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEAppli
    cation.java:113)
            at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl
    e.java:194)
            at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
    cation(EclipseAppLauncher.java:110)
            at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
    lipseAppLauncher.java:79)
            at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
    va:368)
            ASTManager: internalGenerateGetCompletionsForModule: pylab -
            ASTManager: getGlobalCompletions: pylab -
            ASTManager: getBuiltinCompletions
            ASTManager: END getBuiltinCompletions
            ASTManager: internalGenerateGetCompletionsForModule: matplotlib.pylab -

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-09-30

    How much memory is eclipse using when that happens? Have you tried raising it?

    To do that add the -Xmx flags to eclipse.ini, so, it should look as:

    -vmargs
    -Xms40m
    -Xmx384m

    Note that each of those must be in a separate line.

    Cheers,

    Fabio

     
  • Ian Bell

    Ian Bell - 2010-09-30

    When it tries to autocomplete, the memory usage goes up to 620 MB, but idles around 215 MB normally.  I tried increasing the heap max size with

    -Xmx512m

    but it didn't make a difference.  Perhaps this is a bug in pydev?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2010-10-05

    Can you report that as a bug? It'd be nice if you were able to add a memory dump to the report (see http://wiki.eclipse.org/index.php/MemoryAnalyzer for details on how to get a heap dump)

    Cheers,

    Fabio