Memory Allocation?

M.E.Farmer mefjr75 at hotmail.com
Mon Feb 7 22:28:56 EST 2005


Chris S. wrote:
>Using similar logic, we shouldn't need access to the Garbage Collector
>or Profiler. After all, why would anyone need to know how fast their
>program is running or whether or not their garbage has been collected.
>Python takes care of it.
Exactly! Even though there are a few who just won't listen ;)
I answered earlier that the *way* CPython allocates and uses memory it
was kinda useless. Similar objects  in CPython and Jython and .etc..
have different implementions and consequently have different memory
footprints. Do you just want to keep track of average memory? Or do you
want know exactly when an object is collected and the memory is freed?
 If so, that is also one of those grey areas of Python, objects are
collected and memory is freed at differing times , depending on several
factors plus the phase of the moon.
Lots of devils and plenty of details. If I am wrong someone correct me
;)
If you search around you can find many pointers to memory effecient
coding style in Python( never add a string together, use a list and
append then join, etc.)
Stick to profiling it will serve you better. But do not let me stop you
from writing  a  memory profiler ;)
M.E.Farmer




More information about the Python-list mailing list