Running the code on the current master seems to work fine. Given that we are 
going to land another release, this problem may not appear in v0.7

Notably, there are constant memory used by global singletons which will always 
stay the same.

```
import os, psutil
import tvm
from tvm import te

def tvm_build():
    n = 2
    A = te.placeholder((n,), name='A')
    B = te.placeholder((n,), name='B')
    C = te.compute(A.shape, lambda *i: A(*i) + B(*i), name='C')
    s = te.create_schedule(C.op)
    m = tvm.driver.lower(s, [A, B, C], name="test_add")
    rt_mod = tvm.driver.build(m, target="llvm")

def main():
    process = psutil.Process(os.getpid())
    for i in range(0, 1000):
        tvm_build()
        print('i='+str(i)+', Used Memory:', process.memory_info().rss / 1024 / 
1024, 'MB')


main()
```





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/memory-leak-how-to-free-memory-manually-after-building-a-operator-for-long-running-building-case/8037/2)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/a72b30681e48897e22ec29b8fbfc8d83f40375abef1e10112a2284a4481a7d9b).

Reply via email to