Menu

#1476 Debug Variables memory leak

pending
debugger (210)
5
2012-03-27
2012-02-26
Rinze
No

Before I start, I must apologize that I did not include a minimal case for this bug. Whenever I try to construct one, the leak does not occur.

I have one instruction in my code, that, whenever I step through it in debug mode, the python process running the debugger will start eating RAM like crazy. The debugger becomes unresponsive, the Variables tab goes blank, but Eclipse is otherwise still running fine.

This only happens when the Variables tab in the debug-view is visible, so my obvious guess is that the debugger chokes on calculating the current value of some variable.

The instruction that causes the trouble is the simple assignment of a parameter to a private attribute. This assignment is part of a setter method used in a property of the containing class. The code functions as expected and without trouble when run normally.

I realize this is not much to go by, so I will keep trying to build a minimal case. Also, I'm open to any pointers or requests for additional information.

System:
Win7 64bit
Eclipse 3.7.2
Python 2.7
Pydev 2.3 AND 2.4

Discussion

  • Rinze

    Rinze - 2012-02-26

    Addition:

    The offending statement assigns a string value to an attribute and ends with two '%s' placeholders, separated by a comma: "foo bar %s,%s"

    If I remove the comma or append some word to the string ("foo bar %s %s" or "foo bar %s,%s banana"), the error does not occur.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2012-03-27

    The usual issue here would be the following:

    In the PyDev debugger, when the variables view is shown, it'll do a dir() on all the objects on the namespace and an str() on each of those, so, it's usually the case where your code has some issue during this operation (i.e.: when doing str() on some object ends up generating a string that's huge or attempting to do that enters in some kind of recursion).

    This hapens in org.python.pydev.debug/pysrc/pydevd_vars.py in the function varToXML (you can add prints there to know in which object it's doing str or rep) and maybe print some timings there to try to discover which object in your app has that behavior...

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2012-03-27
    • status: open --> pending