Skip to content

Commit 492f0cd

Browse files
author
Jonathan Rocher
committed
Added a demo of the memory profiler package.
1 parent ef43891 commit 492f0cd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mem_profile_test.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
""" File to test the memory profiler package. To run it,
2+
3+
python -m memory_profiler mem_profile_test.py
4+
"""
5+
6+
@profile
7+
def my_func():
8+
a = [1] * (10 ** 6)
9+
b = [2] * (2 * 10 ** 7)
10+
del b
11+
return a
12+
13+
if __name__ == '__main__':
14+
my_func()

0 commit comments

Comments
 (0)