I'm trying to find the memory usage of an in-memory table in q
. How can I display this?
It is receiving live updates and I would like to keep track of the total used memory of such a table.
I can't seem to find any relevant functions/commands for this. I need something like hcount
for file locations, but an in-memory version.
-22!
returns the size in bytes of in-memory objects. e.g.
q)t:([] a:til 1000)
q)-22!t
8031
q)/ 1000 longs = 1000*8 bytes + a small header
q)t:([] a:til 2000)
q)-22!t
16031
If you are interested in how memory management in kdb works I recommend this tutorial: http://www.timestored.com/kdb-guides/memory-management (Disclaimer: I wrote it.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With