> I have a vague memory of reading somewhere that it's possible to > replace the Python memory allocator. This would be an option, if > there's no simple way to say "your maximum is now 16MB", but I now > can't find it back. Was I hallucinating?
You can adjust the implementations of PyMem_Malloc and PyObject_Malloc. This would catch many allocations, but not all of them. If you adjust PyMem_MALLOC instead of PyMem_Malloc, you catch even more allocations - but extensions modules which directly call malloc() still would bypass this accounting. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list