Is it possible to calculate serialized size of an object without allocating memory to hold serialized data?

StackOverflow https://stackoverflow.com/questions/19957320

  •  30-07-2022
  •  | 
  •  

سؤال

This is for a user interface to kdb, where a user can run arbitrary queries. I want to check the size of result and alert the user if it is likely to cause memory overflow on the client.

I can do

count -8!"my query result"

but I suspect that kdb will allocate a buffer to hold serialized content. Is there a way to avoid that?

Alternatively, is there a way to get memory size taken up by kdb object (internal representation), and would that be "close enough" to its serialized form?

هل كانت مفيدة؟

المحلول

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top