memory leak "import random"

Sebastian Tusk sebastian.tusk at silver-style.com
Mon Jun 23 10:40:24 EDT 2003


Hi,

i have a problem with the following code snippet.

#include "Python.h" // python 2.2.3

int main( int argc, void** argv )
{
        while(1) {
                Py_Initialize();

                if(PyRun_SimpleString( "import string" )) {
                        return -1;
                }

                Py_Finalize();
        }

        return 0;
}

It seems that there is a memory leak as the reserved memory grows eternally.
Do i have something wrong or is this a known issue.

Regards,
Sebastian






More information about the Python-list mailing list