Home › Forums › kdb+ › perform gc per .z.pg › Re: perform gc per .z.pg
-
Is there a reason you cannot use -g 1 ?
Running .Q.gc[] so often is not the best approach but if you needed to a timer could check and run if after .z.pg for you:
runGC:0b .z.pg:{ bigresult: value x;runGC::1b; bigresult }; .z.ts:{if[runGC;.Q.gc[];runGC::0b]} t 1
https://code.kx.com/q/ref/dotz/#zts-timer
To run it less often you could set a threshold and in the if statement check memory usage