« How do I extract the milliseconds from a time? | Main | How portable is q code across operating systems? »

Can I simply invoke garbage collect and clear the root namespace instead of restarting the process to reinitialize my database?

Almost. The symbol pool, however, will remain uncleared:

$ rlwrap q
KDB+ 2.7 2011.02.16 Copyright © 1993-2011 Kx Systems
q).Q.gc[]
0j     / as expected, gc is a no-op
q).Q.w[]
used| 108432
heap| 67108864
peak| 67108864
wmax| 0
mmap| 0
syms| 538
symw| 15638
q)-1000000?`6    / 1 million symbols of length 6
`milgli`igfbag`kaodhb`bafclb`kfhogj`jecpae`kfmohp`lk..
q).Q.w[]
used| 108592
heap| 67108864
peak| 67108864
wmax| 0
mmap| 0
syms| 1000539 / bumped by a million
symw| 31400168
q).Q.gc[]
0j      / no-op again!
q).Q.w[]
used| 108592
heap| 67108864
peak| 67108864
wmax| 0
mmap| 0
syms| 1000539 / remains unchanged
symw| 31400168
q)

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Textile formatting is allowed.