Help: sizeof() and reference in python?

Johannes Nix Johannes.Nix at
Tue Mar 14 22:04:09 CET 2000

"Gene Chiaramonte" <gchiaramonte at> writes:

> When working with large datasets, I need to monitor memory usage, so I can
> warn a user about impending doom before it happens and they call me
> screaming that my program sucks. Thus, I can tell them they suck first.

One question:

If it is important that you don't go out of memory, why not write it
in a way that it won't go out of memory, for example use files and let
the OS do buffering with otherwise unused RAM? This would be the
simplest approach.

If you want to make it more cmplicated, for example you could monitor
the system and adjust memory usage to existing memory. But this may
turn out difficult.

Remember that on a workstation, memory could change dynamically and
that you can't predict how it will change. Given the privileges, you
could also adjust virtual memory while your program is running.

The deeper problem is that memory isn't a fixed quantity (and that
regaining memory may need more memory, too).

Normally there should exist some excess of RAM memory for performance
reasons, and a quite safe amount of virtual memory (unless you are
programming diskless systems..). If not, the installer of the computer
may be the sick one.



More information about the Python-list mailing list