killing thread ?

Tim Peters tim.one at comcast.net
Sat Jan 25 08:29:03 EST 2003


[Paul Rubin]
> Is there an obstacle to instrumenting the memory allocator to remember
> how much memory has been allocated by sandboxed code?

Well, "the memory allocator" doesn't exist -- there's no choke point for
allocations, outside of the platform C malloc.  If the latter has
instrumentation, then it can be asked.  The Python object allocator knows
how many "arenas" it has in hand, so that part is easy, but not everything
goes thru the Python object allocator.  Even so, the Python object allocator
has no idea how much memory is actually consumed by the platform C malloc
when it asks the latter for "an arena".  Bottom line:  all memory ultimately
comes from C malloc, and only C malloc knows what C malloc really does.






More information about the Python-list mailing list