MCPcopy
hub / github.com/uber/aresdb / estimateLiveBatchMemoryUsage

Method estimateLiveBatchMemoryUsage

query/aql_processor.go:1040–1055  ·  view source on GitHub ↗

estimateLiveBatchMemoryUsage estimate the GPU memory usage for live batches

(batch *memstore.LiveBatch)

Source from the content-addressed store, hash-verified

1038
1039// estimateLiveBatchMemoryUsage estimate the GPU memory usage for live batches
1040func (qc *AQLQueryContext) estimateLiveBatchMemoryUsage(batch *memstore.LiveBatch) int {
1041 columnMemUsage := 0
1042 for _, columnID := range qc.TableScanners[0].Columns {
1043 sourceVP := batch.Columns[columnID]
1044 if sourceVP == nil {
1045 continue
1046 }
1047 columnMemUsage += int(sourceVP.GetBytes())
1048 }
1049 if batch.Capacity > qc.maxBatchSizeAfterPrefilter {
1050 qc.maxBatchSizeAfterPrefilter = batch.Capacity
1051 }
1052 totalBytes := qc.estimateMemUsageForBatch(batch.Capacity, columnMemUsage, batch.Capacity)
1053 utils.GetQueryLogger().Debugf("Live batch %+v needs memory: %d", batch, totalBytes)
1054 return totalBytes
1055}
1056
1057// estimateArchiveBatchMemoryUsage estimate the GPU memory usage for archive batch
1058func (qc *AQLQueryContext) estimateArchiveBatchMemoryUsage(batch *memstore.ArchiveBatch, isFirstOrLast bool) int {

Callers 2

Calls 4

GetQueryLoggerFunction · 0.92
GetBytesMethod · 0.65
DebugfMethod · 0.65

Tested by

no test coverage detected