Python memory use (psyco, C++)

Terry Reedy tjreedy at udel.edu
Mon Jun 21 21:36:39 EDT 2004


"Roy Smith" <roy at panix.com> wrote in message
news:roy-BBCCA8.12283321062004 at reader2.panix.com...
> I understand that psyco significantly increases memory use.  Is that for
> code or data?

Code.  The amount depends on how much code is psycoized and how many
specialized versions of each block of code it ends up compiling.  I have
the impression that the amount is perhaps megabytes, not 10s of megabytes.

 > Also, for that memory intensive application, how should I expect Python
> memory use to compare with C++?

If you have large arrays of numbers and use Numerical Python or Numarray,
space and speed are comparable.  If you have large chunks of text (millions
of bytes each), space is about same.  If you have millions of separate
objects (network, dict with millions of 6 byte words), then I expect memory
overhead of Python to be larger, perhaps enough to be a problem.  A more
specific description of your situation will get more specific answers,
possibly with specific ways to reduce bloat.

Terry J. Reedy





More information about the Python-list mailing list