KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ What did -11!log do underlying

  • What did -11!log do underlying

    Posted by xiaocheng on December 29, 2021 at 12:00 am

    Hi Community,

     

    I tried to replay a tickerplant file (~12GB), with -11!logfile.

    After done, I tried .Q.w[] and saw iterms, used ~18GB, heap ~33GB.

    Then I called .Q.gc[], used still ~18GB, heap ~18GB, 15GB space were freed after gc.

    To better manage the memory used, my questions are:

    1. What did -11!logfile do underlying, looks like it used extra 15GB mem, can we optimize this?

    2. Is there any auto gc function/procedure, or only available for manual .Q.gc[] calls.

     

    Thanks,

    Xiaocheng

     

    xiaocheng replied 9 months, 1 week ago 2 Members · 3 Replies
  • 3 Replies
  • leades

    Member
    December 29, 2021 at 12:00 am

    Hello,

    Returning with some feedback; the -11! command itself is not consuming large amounts of memory. It simply reads each line of the log file and applies ‘value’ to it. So the memory will be consumed by what happens when value is applied. It’s usually something simple like an insert or update to a table but it can be more complex leading to more memory usage.

    Secondly, you can set garbage collection to immediate by using

    system”g 1″

    It is to an extent automatic but it doesn’t have the full effect as the manually invoked .Q.gc[]. Here is some documentation with more information; https://code.kx.com/q/basics/syscmds/#g-garbage-collection-mode and https://code.kx.com/q4m3/13_Commands_and_System_Variables/#13110-garbage-collection-g.

    I hope this helps.

    Many Thanks

    Luke

  • leades

    Member
    December 29, 2021 at 12:00 am

    Hello,

    Great questions for the Community! Here is some more documentation about replaying log files that might be useful, https://code.kx.com/q/kb/replay-log/. I have reached out internally for a more detailed response.

    Many Thanks

    Luke

  • xiaocheng

    Member
    December 30, 2021 at 12:00 am

    Thanks!

Log in to reply.