Ok, so I'm running a rather large Python application based on arcpy on two separate machines - one of them is leaking memory and one is not. Both are running the same operation in the software.
The leaking machines is:
- A nearly new Lenovo T420s
- Intel Core i5-2540M processor
- 8 GB DDR 3 RAM
- Windows 7 x64 Professional (non-domain joined)
- 128 GB Toshiba SSD
- running ArcGIS 10.0 SP4 with pyodbc installed into the Python directory(only third party module installed)
The nonleaking machine is:
- A 1.5 year old Dell Optiplex 980
- Intel Core i7 870
- 8 GB DDR 3 RAM
- Windows 7 x64 Professional (domain joined)
- 500 GB Western Digital 7200RPM HDD
- running a brand new (today due to another issue with ArcGIS) intallation of ArcGIS 10.0 SP4 with pyodbc installed (also the only 3rd party module
I also have this same software running on other machines without leaking, but I haven't run this same operation recently or on SP4, so I'm leaving them out.
The software I'm running is here: https://bitbucket.org/nickrsan/pisces - The segment of it that's running is the mapping module (PISCES.mapping). Basically, it runs off the command line and is taking is input data from a Personal Geodatabase, generating layers based upon returned keys from stored queries, and adding those layers into template mxds and outputting them as PDFs/MXDs. All of the leaking portion uses arcpy.mapping and I suspect that's the culprit.
The nonleaking machine runs the software utilizing approximate 200 MB of RAM the whole time. The leaking machine starts around 150 MB, and slowly winds its way up to around 1.25 GB where arcpy calls (load layer, output PDF, etc) start failing.
Has anyone had any similar experiences? I know arcpy leaks memory sometimes and have had similar (but less severe) situations before. Any suggestions on how to track down a leak like this? Any best practices on the types of things I can do/avoid in arcpy to not have memory leaks? I've been using the gc module, but I think I'm not reading its output correctly. I'm relatively certain that it's not my code, but who knows.
Thanks in advance for your help.