Is it possible to have an actual memory leak in Python because of your code?

后端 未结 6 920
时光取名叫无心
时光取名叫无心 2020-12-12 13:58

I don\'t have a code example, but I\'m curious whether it\'s possible to write Python code that results in essentially a memory leak.

6条回答
  •  时光说笑
    2020-12-12 14:09

    Since many modules are written in C , yes, it is possible to have memory leaks. imagine you are using a gui paint drawing context (eg with wxpython) , you can create memory buffers but if you forgot to release it. you will have memory leaks... in this case, C++ functions of wx api are wrapped to python.

    a bigger wrong usage , imagine you overload these wx widgets methods within python... memoryleaks assured.

提交回复
热议问题