Represents the memory usage of a cell.
Represents the memory usage of a scoring engine's cells and pools (ignoring any double-counting from sharing with other scoring engine instances).
Represents the memory usage of a collection of scoring engines, properly accounting for cells and pools that are shared among the instances.
Abstract trait for all memory units.
Represents the memory usage of a pool.
Represents memory usage of an item as a quantity with units and exactness flag.
MemoryUnit
for bytes.
MemoryUnit
for gigabytes.
MemoryUnit
for kilobytes.
MemoryUnit
for megabytes.
MemoryUnit
for terabytes.
Finds the best unit of measure: the largest unit for which the amount is greater than 1.
Finds the best unit of measure: the largest unit for which the amount is greater than 1.0, if bytes
is positive.
Compute the memory usage for an instance
of a given avroType
.
Compute the memory usage for an instance
of a given avroType
.
This method can be much slower than compute(avroType)
.
This function will first attempt to compute(avroType)
(without instance
) and only revert to a general computation if needed.
Memory usage for the following types are computed exactly:
avroType
aloneinstance
can be computed exactlyMemory usage for the following types are estimated with polynomials:
Vector
, ultimately a tree structure whose balancing depends on a complex algorithm)Map
, ultimately a tree structure whose balancing depends on a complex algorithm)instance
is approximatePrimitives are assumed to be boxed unless they are found in records, in which case they are unboxed.
the type of the instance
to estimate
the particular instance to estimate
a Usage
object (no Option
)
Compute the memory usage for a given avroType
if that usage can be determined without reference to a particular instance.
Compute the memory usage for a given avroType
if that usage can be determined without reference to a particular instance.
This method can be much faster than compute(avroType, instance)
.
The following types can be computed from an avroType
alone:
avroType
alone.The following cannot:
avroType
aloneavroType
alone, but this case is not handled)Primitives are assumed to be boxed unless they are found in records, in which case they are unboxed.
the type to estimate
Some(usage)
if the usage can be calculated without reference to a particular instance; None
otherwise.