11 lines
295 B
Python
11 lines
295 B
Python
from ctypes import c_int
|
|
from memory_profiler import memory_usage
|
|
|
|
def create_ctypes_ints():
|
|
ctypes_ints = [c_int(i) for i in range(10000)]
|
|
return ctypes_ints
|
|
|
|
if __name__ == '__main__':
|
|
mem_usage = memory_usage(create_ctypes_ints)
|
|
print(f"Memory usage: {mem_usage[0]:.2f} MiB")
|