1 Thread = 3 interpreter launched ???

Diez B. Roggisch deets at nospam.web.de
Sat Apr 7 17:17:50 EDT 2007


nono240 at gmail.com schrieb:
> 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



More information about the Python-list mailing list