execfile eats memory

Enrique Palomo Jiménez enrique.palomo at xgs-spain.com
Mon Sep 19 05:31:59 EDT 2005


On friday i wrote a this message:
[...]
I'm writing an application who needs to handle a lot of information of several files.
So, i think the better way is design a batch process to catch that information in a dictionary and write it in a file.
So, after that when a user wants to retrieve something, only with an execfile i'll have all the information avaiable.

Creating the file with pythonic syntax will be a hard job so,

is there some module to do that?
is there a better way?

The information will be used no more than 3-4 days a month and install databases is not allowed.
[...]
Someone suggest me the pickle module. I'll try it and it works, but pickle dumps is slower than writing the file with pythonic syntax. (26 seconds vs 6)
After that, i have a DIC.txt to execfile with it. The application dies there.
The memory grow up till de limit.
Is possible that execfile of a 19 mb file takes more than 600 mb of memory?
thanks



More information about the Python-list mailing list