1 Thread = 3 interpreter launched ???

N

nono240

Hi all, and thanks for reading !

I'm using Python 2.4.2 with an embedded platform (16MB RAM) running
Linux 2.6.20.
My main script use a thread for some reasons (more precisely a
periodic timer within a separate module).
While looking at the memory consumption, here's what i found :

PID USER STATUS RSS PPID %CPU %MEM COMMAND
171 root R 384 164 1.5 2.6 top
218 root R 4172 217 0.1 29.1 main_script.py
216 root S 4172 180 0.0 29.1 main_script.py
217 root S 4172 216 0.0 29.1 main_script.py

When creating the thread, Python forks 2 times and thus consume me
around 60% of RAM !

Is it a normal behaviour while using threads ???

It's very critical, am i missed something ?

Thank U...
 
D

Diez B. Roggisch

Hi all, and thanks for reading !

I'm using Python 2.4.2 with an embedded platform (16MB RAM) running
Linux 2.6.20.
My main script use a thread for some reasons (more precisely a
periodic timer within a separate module).
While looking at the memory consumption, here's what i found :

PID USER STATUS RSS PPID %CPU %MEM COMMAND
171 root R 384 164 1.5 2.6 top
218 root R 4172 217 0.1 29.1 main_script.py
216 root S 4172 180 0.0 29.1 main_script.py
217 root S 4172 216 0.0 29.1 main_script.py

When creating the thread, Python forks 2 times and thus consume me
around 60% of RAM !

Is it a normal behaviour while using threads ???

It's very critical, am i missed something ?

Yes. That some linuxes list each thread as one process. No need to worry...

Diez
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

When creating the thread, Python forks 2 times and thus consume me
around 60% of RAM !
It's very critical, am i missed something ?

In case Diez's answer isn't clear: you misinterpret the data you
see. That each process is listed with 4172kB memory doesn't mean
they consume 12000kB together. Instead, they consume 4172kB
together, as all data are shared across all threads.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top