Embedding Python 2.0 and 2.1? Memory usage, Embedded systems and Leakage.

David LeBlanc whisper at oz.nospamnet
Tue May 15 12:16:30 EDT 2001


In article <mailman.989903602.2515.python-list at python.org>, 
tim.one at home.com says...
> [Warren Postma]
> > ... [questions I can't answer, because it would take work <0.5 wink>] ...
> > ...
> > If anyone else is interested in making a 2.1 subset with deterministic
> > "perfect" heap management, I woud like to hear from you, because it's
> > possible we can work together on this.
> 
> What Python needs here is a general protocol for module finalization (whether
> builtin or external, Python or C).  That would be useful for many "odd"
> reasons.  As-is, few of the many modules under the Modules/ directory ever
> get a *chance* to clean up, so various Python objects pointed to by C statics
> never get decref'ed one last time, so they never get free()'ed either.
> 
> Make the heap cleanup work a matter of principled design rather than
> platform-specific subset hackery, and I bet you could get more mindshare and
> get the changes into the core distribution.
> 
> needs-a-pep-ly y'rs  - tim
> 
> 
> 
Has anyone ever considered using the Boehm-Demers-Weiser garbage 
collecter with python?

"The collector uses a mark-sweep algorithm. It provides incremental and 
generational collection under operating systems which provide the right 
kind of virtual memory support. (Currently this includes SunOS[45], IRIX, 
OSF/1, Linux, Windows NT, and Windows 95, with varying restrictions.) It 
allows finalization code to be invoked when an object is collected. It 
can take advantage of type information to locate pointers if such 
information is provided, but it is usually used without such information. 
See the README and gc.h files in the distribution for more details."

"The collector is not completely portable, but the distribution includes 
ports to most standard PC and UNIX platforms. Win32, win32s, OS/2, and 
UNIX environments are supported on Intel-based PCs, as are all common 
UNIX workstations, MacOS, and AmigaDOS. Some ports are more polished than 
others. 

Irix pthreads, Linux threads, Solaris threads (old style and pthreads) 
and HP/UX 11 threads are supported in the most recent versions. Win32 
thread support appears to be getting more solid in the most recent 
versions. "

This page has moved a few times over the years, and this seems to be the 
most current incarnation - it has files last updated April of 2001:

http://www.hpl.hp.com/personal/Hans_Boehm/gc/gcinterface.html

Dave LeBlanc



More information about the Python-list mailing list