public final class RamUsageEstimator
extends java.lang.Object
Constructor and Description |
---|
RamUsageEstimator()
Constructs this object with an AverageGuessMemoryModel and
checkInterned = true.
|
RamUsageEstimator(boolean checkInterned) |
RamUsageEstimator(MemoryModel memoryModel) |
RamUsageEstimator(MemoryModel memoryModel,
boolean checkInterned) |
Modifier and Type | Method and Description |
---|---|
long |
estimateRamUsage(java.lang.Object obj) |
static java.lang.String |
humanReadableUnits(long bytes,
java.text.DecimalFormat df)
Return good default units based on byte size.
|
public RamUsageEstimator()
public RamUsageEstimator(boolean checkInterned)
checkInterned
- check if Strings are interned and don't add to size
if they are. Defaults to true but if you know the objects you are checking
won't likely contain many interned Strings, it will be faster to turn off
intern checking.public RamUsageEstimator(MemoryModel memoryModel)
memoryModel
- MemoryModel to use for primitive object sizes.public RamUsageEstimator(MemoryModel memoryModel, boolean checkInterned)
memoryModel
- MemoryModel to use for primitive object sizes.checkInterned
- check if Strings are interned and don't add to size
if they are. Defaults to true but if you know the objects you are checking
won't likely contain many interned Strings, it will be faster to turn off
intern checking.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.