You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to read the two orc file, and i found the memory of the first reader have not been released. I found no del() in the Reader. How can i release the memory.
`
import os
import sys
import pyorc
from memory_profiler import profile
import gc
@Profile
def main():
fr = open("000748_0", "rb")
r = pyorc.reader
reader = r.Reader(fr)
for i in range(100):
pass
a = reader.read(1000)
b = reader.read(20000)
c = reader.read(10000)
del reader
del r
del a,b,c
fr.close()
gc.collect()
fr = open("001751_0","rb")
r = pyorc.reader
reader = r.Reader(fr)
cnt = reader.len()
for i in range(cnt):
a = reader.next()
c = [1] * (10 ** 6)
if name == 'main':
main()`
The text was updated successfully, but these errors were encountered:
I've looked into it, and found an unnecessary pybind11:object release call that created dangling/never decremented bytes objects during reading the ORC file. Creating a Reader object includes reading the metadata from the file, thus the faulty function was invoked during the Reader's initialisation.
When i try to read the two orc file, and i found the memory of the first reader have not been released. I found no del() in the Reader. How can i release the memory.
`
import os
import sys
import pyorc
from memory_profiler import profile
import gc
@Profile
def main():
fr = open("000748_0", "rb")
r = pyorc.reader
reader = r.Reader(fr)
for i in range(100):
pass
a = reader.read(1000)
b = reader.read(20000)
c = reader.read(10000)
del reader
del r
del a,b,c
fr.close()
gc.collect()
fr = open("001751_0","rb")
r = pyorc.reader
reader = r.Reader(fr)
cnt = reader.len()
for i in range(cnt):
a = reader.next()
c = [1] * (10 ** 6)
if name == 'main':
main()`
The text was updated successfully, but these errors were encountered: