MCPcopy Index your code
hub / github.com/pythonprofilers/memory_profiler / run

Method run

memory_profiler.py:248–266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

246 super(MemTimer, self).__init__(*args, **kw)
247
248 def run(self):
249 self.pipe.send(0) # we're ready
250 stop = False
251 while True:
252 cur_mem = _get_memory(
253 self.monitor_pid, self.backend, timestamps=self.timestamps,
254 include_children=self.include_children,)
255 if not self.max_usage:
256 self.mem_usage.append(cur_mem)
257 else:
258 self.mem_usage[0] = max(cur_mem, self.mem_usage[0])
259 self.n_measurements += 1
260 if stop:
261 break
262 stop = self.pipe.poll(self.interval)
263 # do one more iteration
264
265 self.pipe.send(self.mem_usage)
266 self.pipe.send(self.n_measurements)
267
268
269def memory_usage(proc=-1, interval=.1, timeout=None, timestamps=False,

Callers 1

test_async.pyFile · 0.80

Calls 1

_get_memoryFunction · 0.85

Tested by

no test coverage detected