Hmm, I just tried something similar to your code (attached) which does
not seem to have any memory leak at all. The code for showing memory
usage only happens to work under Linux but there is no memory growth
at all which suggests that cx_Oracle is not the culprit in this
particular case over some 250000 rows. Could you indicate what=20
version of cx_Oracle, platform and Oracle version you are using? I am
using Linux, Oracle 9i and cx_Oracle 4.1.
On 9/28/05, Mark Harrison <mh...@pi...> wrote:
> I'm seeing a memory leak when running this program which just
> loops over a table and fetches its data.
>
> Is there something I should be doing after a fetchmany to
> free up some memory?
>
> Attached below are some cleaned up output and the test program.
> The "job" table has quite a few fields, including clob's. Should
> I be doing something special with them?
>
> Many TIA!!
> Mark
>
> --
> Mark Harrison
> Pixar Animation Studios
>
>
>
> USER PID %CPU %MEM VSZ RSS
> --- starting
> mh 29770 0.0 0.0 54044 3260
> --- import cx_Oracle
> mh 29770 0.0 0.0 54044 3260
> --- connect
> mh 29770 0.0 0.1 75000 5640
> --- cursor
> mh 29770 0.0 0.2 141904 9860
> --- arraysize
> mh 29770 0.0 0.2 141904 9864
> --- execute
> mh 29770 0.0 0.2 141904 9864
> --- fetchmany
> mh 29770 0.0 0.6 195228 27308
> mh 29770 0.0 2.0 218652 82924
> mh 29770 0.0 2.5 236252 101356
> mh 29770 0.0 2.5 236956 102428
> mh 29770 0.0 2.5 237508 102968
> mh 29770 0.0 2.5 238068 103696
> mh 29770 0.0 2.5 238476 104088
> mh 29770 0.0 2.5 238880 104540
> mh 29770 0.0 2.5 239428 105108
> mh 29770 0.0 2.6 239844 105628
> mh 29770 0.0 2.6 240264 106048
>
>
> import time
> import os
> os.system("ps auxww|head -n 1")
> memsnap('starting')
> memsnap('import cx_Oracle')
> import cx_Oracle
>
> user =3D 'zzz'
> passwd =3D 'zzz'
> connurl =3D 'racdb'
>
> os.environ['TNS_ADMIN']=3D'/u0/mh/oracle'
>
> memsnap('connect')
> connection =3D cx_Oracle.connect(user, passwd, connurl)
>
>
> memsnap('cursor')
> cursor =3D connection.cursor() memsnap('arraysize')
> cursor.arraysize =3D 10000
>
> memsnap('execute')
> cursor.execute('select * from job')
> done =3D 0
> tot =3D 0
> print '---'
> while not done:
> memsnap('fetchmany')
> result =3D cursor.fetchmany(10000)
> dir(result)
> tot +=3D len(result)
> if len(result) =3D=3D 0:
> done =3D 1
> result =3D []
>
> cursor.close()
>
> connection.close()
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> cx-oracle-users mailing list
> cx-...@li...
> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
>
|