1 Thread = 3 interpreter launched ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nono240@gmail.com

    #1

    1 Thread = 3 interpreter launched ???

    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...

  • Diez B. Roggisch

    #2
    Re: 1 Thread = 3 interpreter launched ???

    nono240@gmail.c om 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

    Comment

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

      #3
      Re: 1 Thread = 3 interpreter launched ???

      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

      Comment

      Working...