US 11,816,106 B2
Memory management for KLL sketch
Gourav Kumar, Bangalore (IN); Rajkumar Iyer, Bangalore (IN); and Ravi Shirish Shetye, Bangalore (IN)
Assigned to Microsoft Technology Licensing, LLC, Redmond, WA (US)
Filed by Microsoft Technology Licensing, LLC, Redmond, WA (US)
Filed on Mar. 9, 2022, as Appl. No. 17/690,569.
Prior Publication US 2023/0289346 A1, Sep. 14, 2023
Int. Cl. G06F 16/00 (2019.01); G06F 16/2455 (2019.01); G06F 12/0871 (2016.01); G06F 16/248 (2019.01); G06F 12/0882 (2016.01)
CPC G06F 16/24552 (2019.01) [G06F 12/0871 (2013.01); G06F 16/248 (2019.01); G06F 16/24568 (2019.01); G06F 12/0882 (2013.01)] 20 Claims
OG exemplary drawing
 
1. An apparatus for managing memory for a quantile sketch of a streaming set, comprising:
one or more computer memories, individually or in combination, configured to store computer-executable instructions and a representation of the streaming set; and
one or more processors coupled to the computer memory and, individually or in combination, configured to execute the instructions to:
allocate a memory page having an initial amount of memory from the one or more computer memories to a buffer of a quantile sketch data structure based on a sparse sketch size independent of a data type of the streaming set;
determine a supported stream size of the quantile sketch data structure based on a number of levels of the quantile sketch data structure, a number of elements in a highest level, a total allocated amount of memory, and a size of the data type of the streaming set;
allocate one or more additional memory pages having an incremental amount of memory greater than or equal to the initial amount of memory from the one or more computer memories to the buffer of the quantile sketch data structure in response to a size of the streaming set exceeding the supported stream size of the quantile sketch data structure;
determine a number of levels of the quantile sketch data structure based on a total allocated amount of memory and a size of the data type of the streaming set; and
add new elements from the streaming set to the quantile sketch data structure based on the number of levels.