Numba JIT模式内存泄漏问题?
我目前在使用另一个jitter函数的功能上将JIT装饰器在一个函数上遇到的函数时,我目前面临着一个奇怪的内存泄漏问题,该功能返回产量样式
的想法是设计的想法,
@njit
def main_ ():
ss = []
heapq.heapify (ss)
yd = generator_()
result = 0
while 1:
result = next (yd)
if result == []:
break
heapq.heappush (result)
return list (ss)
@njit
def generator_():
for i in range (100000000):
yd2 = generator_2 (i)
while 1:
result = next (yd2)
if result == []:
break
yield [i, result]
yield []
@njit
def generator_2(ii):
for i in range (100000000):
yield ([ii, i*2, i*i])
yield []
即如果函数为main_具有NJIT或NJIT或JIT删除了,不会发生内存问题。我也称为GC Collection,但似乎AINT做了很多事情。我还发现了一些讨论表明,它将与LLVM相关,因为它存储了它编制的所有内容。
任何人都可以给我一些意见,问题是什么。
感谢您
I am currently facing a weird memory leak problem when having jit decorator on a function which uses heapify takings results from another jitted function which return results in yield style
here is the idea of the design to indicate the issue
@njit
def main_ ():
ss = []
heapq.heapify (ss)
yd = generator_()
result = 0
while 1:
result = next (yd)
if result == []:
break
heapq.heappush (result)
return list (ss)
@njit
def generator_():
for i in range (100000000):
yd2 = generator_2 (i)
while 1:
result = next (yd2)
if result == []:
break
yield [i, result]
yield []
@njit
def generator_2(ii):
for i in range (100000000):
yield ([ii, i*2, i*i])
yield []
If the function main_ having the njit or jit removed, the memory issue would not happened. I have also called gc collection but it seems like aint doing much. I have also found some discussion shows it would be relate to llvm as it store everything it compiled.
Would anyone would be able to give me some opinion what exact the problem is.
Thanks you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚面对同样的问题
提出了ostertionerror
I've just faced the same issue
raises AssertionError