8

I was wondering if there is a Python equivalent of Java's VisualVM. The feature that I need is real-time profiling of a running Python interpreter.

A bit of background: a recent change to my code base slowed it down considerably. I would like to find out what my code is doing without having to restart the calculation. The alternative is to stop the interpreter and to restart it with -m cProfile, losing a day of CPU time.

Any suggestions are greatly appreciated.

mbatchkarov
  • 15,487
  • 9
  • 60
  • 79
  • Python has a `sys.set_trace` that can be set while the program runs. It should be possible to start profiling while the program runs. – User May 30 '13 at 14:13

1 Answers1

1

Have a look here: Is there a visual profiler for Python? and here: Which Python memory profiler is recommended?

From what I found, there isn't really an easy way to do memory profiling if your application is more than just a script. Otherwise the easiest is to use https://pypi.python.org/pypi/memory_profiler.

Community
  • 1
  • 1
Jan DB
  • 355
  • 2
  • 6