I have a geoprocessing script that runs the following..
Yes just one line of code.
A blank .mxd starts at 391kb for me as I run my script and save the filesize increases.
391 kb 431 kb 451 kb 471 kb and so on...
A geoprocessing python script seems to increase the filesize by 20-30 kb each time.
I have run this test on an actual script that does something and increases filesize by 40-60 kb...
I have also run on a blank script that does absolutly nothing other than it runs and still increases filesize by 20-30kb...
From what I could find ESRI Tech
file size increase may be caused by a large amount of geoprocessing results stored in the Results tab in ArcToolbox in ArcCatalog.
Following the steps in the article I was able to decrease the filesize from 589 kb to 293 kb by saving it to a new .mxd
Your thoughts, experiences with this? Has anyone found a way to auto-delete the results tab from a python script so that I don't have to save a new .mxd each time?
@AHIGH I have tried playing around with the Geoprocessing options as suggested by AHIGH. Does not seem to stop the filesize from increasing.
@artwork21 If I go to geoprocessing > results and delete the results this WILL decrease the filesize. Is there anyway to automate this process so that the results are auto-deleted after the script has run?
Any tool results still in the ArcMap table of contents will be saved to disk, regardless of the temporary results setting. This is because geoprocessing has to assume that by saving a map document, you want everything in the ArcMap table of contents saved
I want everything to save except for the results that bloat my filesize...
If you don't want to save the map document, but you do want to save the data in an individual layer, right-click the layer and click Data > Make Permanent.
Not really a practical solution...
In 10.1 there are new features that would allow me to fix my problem. Guess will have to try to push my company to upgrade to 10.1 ASAP.
Under Geoprocessing > Geoprocessing Options > Results Management > "Keep results younger than:" > Set to Never Save.
This will stop the filesize from increasing.
Alternatively, you can try to write your scripts so that the run independently of Arcmap (ie. Without it open).
You can write more efficient code, that runs faster. Like a script that runs multiple mxd's at once.