Threads Optimizing Linux.
Hello , my question is a bit complex ( for me ). I have : - Linux RH 6.1 - python 1.5.2 --with-thread (source compiled) - zope 2.2.x or zope 2.3.x (source compiled) In any program in python with Linux (inclusive Zope), the threads are processes,i.e, they consume memory and don´t share it. In Windows this is different. In Linux, I have Zope running with 4 Threads. I have five processes and everyone consuming about 12 MB => 12 * 5 MB = 60 MB In Windows in the same situation I only have one process and the threads share the memory, which is the most desirable situation. Why?? Does anybody know a solution for Linux, in order to have only one process and threads sharing memory, as in Windows?? Thanks. Aitor /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Aitor Grajal Crespo Director General e-mail: aitor.grajal@inetsys.es INETSYS, S.L. ETSI Informática Ctra. Colmenar, km. 15,500 28049 MADRID SPAIN Tfno : (34) 91 348 22 66 - Fax : (34) 91 348 22 66 http://www.inetsys.es /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
On Mon, 16 Apr 2001, Aitor Grajal Crespo wrote:
In Linux, I have Zope running with 4 Threads. I have five processes and everyone consuming about 12 MB => 12 * 5 MB = 60 MB
These are not 5 processes - these are real threads, all memory is shared. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Scavenging the mail folder uncovered Aitor Grajal Crespo's letter:
Hello , my question is a bit complex ( for me ). I have :
- Linux RH 6.1 - python 1.5.2 --with-thread (source compiled) - zope 2.2.x or zope 2.3.x (source compiled)
In any program in python with Linux (inclusive Zope), the threads are processes,i.e, they consume memory and don´t share it.
this is completely wrong. threads under linux have a different pid but are created setting the CLONE flag so they share almost anything (address space, shared objects, etc.)
In Linux, I have Zope running with 4 Threads. I have five processes and everyone consuming about 12 MB => 12 * 5 MB = 60 MB
this is what top tell you, but try using memstat to show the real memory consumed by each process... ciao, federico -- Federico Di Gregorio MIXAD LIVE Chief of Research & Technology fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org All programmers are optimists. -- Frederick P. Brooks, Jr.
On Mon, 16 Apr 2001, Aitor Grajal Crespo wrote:
In Linux, I have Zope running with 4 Threads. I have five processes and everyone consuming about 12 MB => 12 * 5 MB = 60 MB
In Windows in the same situation I only have one process and the threads share the memory, which is the most desirable situation.
Why?? Does anybody know a solution for Linux, in order to have only one process and threads sharing memory, as in Windows??
I'm sorry, I just can't resist: upgrade to FreeBSD <grin>. Seriously, under Linux for some reason separate threads have separate PIDs, and top and its bretheren show the full memory compliment for each PID, yet they actually share the memory. Under FreeBSD the separate threads do *not* show up as separate PIDs, so things look normal. But in either case, things are actually working the way you want them to. (NB: I'm not on the main zope mailing list, but I've paired zope-dev off the list as this is more of a 'zope' question than a 'zope-dev' question, and as the message footers all say, crossposting between the two lists is highly discouraged.) --RDM
On 16 Apr 2001 18:15:12 +0200, Aitor Grajal Crespo wrote:
Hello , my question is a bit complex ( for me ). I have :
- Linux RH 6.1 - python 1.5.2 --with-thread (source compiled) - zope 2.2.x or zope 2.3.x (source compiled)
In any program in python with Linux (inclusive Zope), the threads are processes,i.e,
No, this is incorrect. they consume memory and don´t share it.
In Windows this is different.
In Linux, I have Zope running with 4 Threads. I have five processes and everyone consuming about 12 MB => 12 * 5 MB = 60 MB
No, this is incorrect as well. Those are threads, each charing the memory, not each using 12MB. If you look into the archives of the zope lists you will see several threads on this where it is shown that it is not as you describe it.
participants (5)
-
Aitor Grajal Crespo -
Bill Anderson -
Federico Di Gregorio -
Oleg Broytmann -
R. David Murray