Menu

#290 Memory leak

MySQLdb-1.2
closed
MySQLdb (285)
5
2012-09-19
2009-09-11
No

When i execute the attached test case the interpreter grows to ~500 MB and stays there. shouldn't the memory been freed? pyodbc+mysql frees the memory imidiatly. This applies also to version 1.2.3.*

Discussion

  • Bjoern Thorwirth

     
  • sevenj

    sevenj - 2009-10-14

    it is not mysql-python's memory leak. It is python's memory leak! in python, it will cache the int,string(see python's source). so in your testcase, python would cache all strings(although in this testcase,all strings are same,but python don't know this). but I don't know why pyodbc free the memory. please upload the pyodbc testcase!

     
  • sevenj

    sevenj - 2009-10-20

    sorry, there are some error! In this test case python not cache string, but because of the python memory pool, it keep the memory.

     
  • sevenj

    sevenj - 2009-10-28

    In python, python has itself memory pool. when small object (<= 256) , python will use memory pool, big object direct use malloc. so when use small object, python will 'cache' it; use big object , glibc will 'cache' it.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.