Hi.

I need to clean memory on function on PyEval_SetTrace.
When the python code run a while test, the memory consumption goes up a lot (99% of the system).
exemple:
while 1 == 1:
     pass

My trace function is simple.

static map<char *, int, cmp_str> session_debug_user;
char *user_console;

int trace_trampoline(
    PyObject *objPyFrameObject *frameint eventPyObject *arg)
{
    try
    {
        //check if user has debug session
        if (session_debug_user.count(user_console) == 0)
        {
            return 0;
        }
  return 0;
}

PyObject *sys_settrace(PyObject *modPyObject *obj)
{
    user_console = get_variable_char(obj, 0); 
    PyEval_SetTrace(trace_trampoline, obj);
    return Py_None;
}




Att.

Leandro Müller