Vikas
2015-10-21 13:37:39 UTC
Hi,
I am trying to instrument method: run() for memory profiling(I am using
memory_profiler & guppy tools for this). All I need to do is decorate
the run() with "profile" decorator and mention *start* and *end* of
memory profiling.
@profile
def run():
d = {}
l = []
hp = hpy()
before = hp.heap() => *start* memory profiling from here
d["k1"] = 'val1'
d["k2"] = 10
count = 0
while (count < 9):
l.append(count)
print 'The count is:', count
count = count + 1
print "Good bye!"
after = hp.heap() => *end* memory profiling here
leftover = after - before
print leftover
del hp
So far works fine. But moment I introduce @inlineCallbacks before
@profile(see below), I don't see memory getting profiled. Am I doing
something wrong here?
@inlinecallbacks
@profile
def run():
....
Regards
Vikas
I am trying to instrument method: run() for memory profiling(I am using
memory_profiler & guppy tools for this). All I need to do is decorate
the run() with "profile" decorator and mention *start* and *end* of
memory profiling.
@profile
def run():
d = {}
l = []
hp = hpy()
before = hp.heap() => *start* memory profiling from here
d["k1"] = 'val1'
d["k2"] = 10
count = 0
while (count < 9):
l.append(count)
print 'The count is:', count
count = count + 1
print "Good bye!"
after = hp.heap() => *end* memory profiling here
leftover = after - before
print leftover
del hp
So far works fine. But moment I introduce @inlineCallbacks before
@profile(see below), I don't see memory getting profiled. Am I doing
something wrong here?
@inlinecallbacks
@profile
def run():
....
Regards
Vikas