title: Monitor python code to check where the process are created
body: <p>When I execute my app I can see multiple process are running for my application. But I am not explicitly any process nor do I remember any call that I am making can create a process. Is there any way to monitor app such I it would point me to line where the process are created in python</p>
  <pre><code>import os
  import threading
  import time
  
  sessionSweeperTime=5
  
  def remove_idle_session():
      threading.Timer(sessionSweeperTime, remove_idle_session).start()
      time.sleep(5)
      print(&quot;Remove idle session pid : {}, ppid : {}&quot;.format(os.getpid(), os.getppid()))
  
  time.sleep(5)
  print(&quot;Main pid : {}, ppid : {}&quot;.format(os.getpid(), os.getppid()))
  remove_idle_session()
  time.sleep(5)
  print(&quot;pid : {}, ppid : {}&quot;.format(os.getpid(), os.getppid()))
  # server started
  </code></pre>
  <h1>This is my output</h1>
  <pre><code>Remove idle session pid : 18924, ppid : 18921
  Remove idle session pid : 18945, ppid : 18924
  Remove idle session pid : 18950, ppid : 18924
  Remove idle session pid : 18947, ppid : 18924
  Remove idle session pid : 18942, ppid : 18924
  </code></pre>
  <p>I am using ubuntu:18:04 inside a docker container</p>