CPC G06F 11/3442 (2013.01) [G06F 9/5016 (2013.01); G06F 2209/508 (2013.01)] | 16 Claims |
1. A system, comprising:
at least one processor; and
at least one memory storing instructions which, when executed by the at least one processor, cause operations comprising:
receiving, from a first thread of a first operator performing a first operation associated with a query, a first request for memory allocation or memory deallocation;
responding to the first request by at least accessing a first local data structure of the first thread to identify the first operator associated with the first request;
updating, based at least on the first request, a first memory usage metric for the first thread of the first operator, wherein the updating of the first memory usage metric includes adding, to a running aggregate of a memory integral, a result of multiplying a size of a current memory allocation by a difference between a current timestamp and a timestamp of a last update;
determining, based at least on the first memory usage metric for the first thread of the first operator and a second memory usage metric for a second thread of the first operator, a third memory usage metric for the first operator; and
responding to the first request by allocating or deallocating at least a portion of a memory allocated to the query.
|