KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
190 stars 49 forks source link

Garbage collection in PyQ #106

Closed antipisa closed 4 years ago

antipisa commented 5 years ago

I am using PyQ 4.2.1 with Python 3.7. I have noticed that sum .Q.gc\[0] efficiently frees up memory on the kdb side and keeps.Q.w[]peak` stable, while gc.collect() on the Python side does not prevent virtual memory from growing. Keeping track of both

.Q.w[]`peak

and

process = psutil.Process(os.getpid())
process.memory_info().rss

in between calling .Q.gc[] and gc.collect(), shows the Python side growing in memory, while the former remains stable, and much smaller, in kdb.

Is there a way to prevent memory leakage in PyQ, or to run the equivalent of

![`.;();0b;tables[]]; sum .Q.gc\[0]

in Python? Does deleting K tables from kdb not free up memory on the Python side?

github-actions[bot] commented 4 years ago

Stale issue message