Help with finding how much memory a variable is using

Rich Somerfield rich_somerfield at tertio.com
Mon Mar 5 04:59:32 EST 2001


The data is being stored in an array of integers.

The problem at the moment is that it was only a guess that the storage of
this data was causing my application to crash.  However after a bit of
hacking it suggests that there are other problems.  I really wanted to watch
memory usage of variables and to see if they were causing problems.

As the data is stored local to a class, and I assign a global variable to
the local variable (breaks scoping rules I know!).  would this data be
stored on the stack / heap?  Or does this suggest a fundamental pointer
problem??  Maybe i should make the data type global and do some tests on
that.

Unfortunately I am discovering bugs I never knew existed (my code is 2 years
old and it seemed to work fine then!!), so cant really perform any tests on
a reliable base system.

Regards
Rich
Neil Schemenauer <nas at arctrix.com> wrote in message
news:mailman.983691965.7856.python-list at python.org...
> "Rich Somerfield" <rich_somerfield at tertio.com> writes:
> > I am generating a huge, huge list of data (cant think of a
> > decent way to reduce the required storage size and have it in a
> > usable form).  Everytime i try to keep this list for future
> > derivations I get a memory problem from Windows (effectively
> > terminating my python script).
>
> Depending on the data in the list the array module may help (eg
> for storing an array of integers).
>
>   Neil
>





More information about the Python-list mailing list