File: reporting_file.py

package info (click to toggle)
python-memory-profiler 0.61-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 540 kB
  • sloc: python: 2,220; makefile: 33
file content (21 lines) | stat: -rw-r--r-- 336 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from memory_profiler import profile

f=open('hi.txt','w+')

@profile(stream=f)
def my_func():
    a = [1] * (10 ** 6)
    b = [2] * (2 * 10 ** 7)
    del b
    return a

@profile(stream=f)
def my_func1():
    a = [2] * (10 ** 6)
    b = [3] * (2 * 10 ** 7)
    del b
    return a

if __name__ == '__main__':
    my_func()
    my_func1()