How hard to allocate ALL Python data space (hence offset-based) in a memory mapped file image?

Steve Holden sholden at holdenweb.com
Thu Dec 19 17:03:55 EST 2002


"Bengt Richter" <bokr at oz.net> wrote ...
[ ... ]
>
> I think it would be COOL to be able to do these things.
> For windows, I suspect it would not be that hard to wrap those two
components in
> a self-launching zip archive .exe. Which might be similar to what freeze
does?
>
> But in any case, I can't think of an easier way to wrap things than just
> capturing memory at the time of a checkpoint call. I.e., pretty much just
store
> the last state info in an object and close the file (and sometimes rename
it).
> COOL or what? ;-)
>
Only for some value of COOL closely approximating to "half-baked", I'm
afraid :-). There are too many things relating to process state (not to
mention thread state) that would no longer be current.

A long time ago, in a galaxy far away, I implemented a Spitbol compiler
which could dump the memory state of a running program, but there were many
caveats. The most important, I seem to remember, was the impossibility of
parsing the command line used to implement the frozen instance. It was a
nice idea that worked for a limited set of circumstances, and if program
state initialization took a lot of time it would be worthwhile working
around the limitations.

In Python, though, we have pickle() and friends to marshall program state,
so there's not really any need to go further in many instances.

> With lots of memory in a server, python state images would presumably tend
to stay
> in memory, and even intitializing a fresh image should go as fast as a
memory-memory
> copy of the -K-specified file. And everything should be ready to go
without all the
> importing and fiddling that was accomplished before the checkpoint.
>
Nice ideas, but probably a pipe dream. If you implement this I will happily
eat my words. I'm suggesting you're misguided, but I'd happily be wrong.

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Bring your musical instrument to PyCon!    http://www.python.org/pycon/
-----------------------------------------------------------------------






More information about the Python-list mailing list