Skip to content

Commit

Permalink
WIP #127
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Nov 21, 2019
1 parent 95f2587 commit e2ee372
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/leak_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


def get_memory():
return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
return resource.getrusage(resource.RUSAGE_SELF).ru_maxrss/1024.

def task():
gc.collect()
Expand All @@ -35,10 +35,17 @@ def task():
gc.collect()
final = get_memory()

print(f"{before} {after} {final}")
d = dict(
time=time.time(),
before=before,
after=after,
final=final,
)

print(f"{d}")


if __name__ == "__main__":
for i in range(65):
for i in range(10):
task()
time.sleep(1.0)

0 comments on commit e2ee372

Please sign in to comment.