Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | List of all members
Lucene.Net.Util.RamUsageEstimator Class Reference

Estimates the size of a given Object using a given MemoryModel for primitive size information. More...

Public Member Functions

 RamUsageEstimator ()
 Constructs this object with an AverageGuessMemoryModel and checkInterned = true.
 
 RamUsageEstimator (bool checkInterned)
 
 RamUsageEstimator (MemoryModel memoryModel)
 
 RamUsageEstimator (MemoryModel memoryModel, bool checkInterned)
 
long EstimateRamUsage (System.Object obj)
 

Static Public Member Functions

static System.String HumanReadableUnits (long bytes, System.IFormatProvider df)
 Return good default units based on byte size.
 

Detailed Description

Estimates the size of a given Object using a given MemoryModel for primitive size information.

Resource Usage:

Internally uses a Map to temporally hold a reference to every object seen.

If checkIntered, all Strings checked will be interned, but those that were not already interned will be released for GC when the estimate is complete.

Definition at line 36 of file RamUsageEstimator.cs.

Constructor & Destructor Documentation

Lucene.Net.Util.RamUsageEstimator.RamUsageEstimator ( )

Constructs this object with an AverageGuessMemoryModel and checkInterned = true.

Definition at line 51 of file RamUsageEstimator.cs.

Lucene.Net.Util.RamUsageEstimator.RamUsageEstimator ( bool  checkInterned)
Parameters
checkInternedcheck 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.

Definition at line 60 of file RamUsageEstimator.cs.

Lucene.Net.Util.RamUsageEstimator.RamUsageEstimator ( MemoryModel  memoryModel)
Parameters
memoryModelMemoryModel to use for primitive object sizes.

Definition at line 66 of file RamUsageEstimator.cs.

Lucene.Net.Util.RamUsageEstimator.RamUsageEstimator ( MemoryModel  memoryModel,
bool  checkInterned 
)
Parameters
memoryModelMemoryModel to use for primitive object sizes.
checkInternedcheck 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.

Definition at line 77 of file RamUsageEstimator.cs.

Member Function Documentation

long Lucene.Net.Util.RamUsageEstimator.EstimateRamUsage ( System.Object  obj)

Definition at line 89 of file RamUsageEstimator.cs.

static System.String Lucene.Net.Util.RamUsageEstimator.HumanReadableUnits ( long  bytes,
System.IFormatProvider  df 
)
static

Return good default units based on byte size.

Definition at line 196 of file RamUsageEstimator.cs.


The documentation for this class was generated from the following file: