blob: e730ce72265eb3b14fe6aecfe8a837d3d8d13270 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>ObjectSizer (Apache Geode 1.15.0)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ObjectSizer (Apache Geode 1.15.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/geode/cache/util/GatewayEvent.html" title="interface in org.apache.geode.cache.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/geode/cache/util/RegionMembershipListenerAdapter.html" title="class in org.apache.geode.cache.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/geode/cache/util/ObjectSizer.html" target="_top">Frames</a></li>
<li><a href="ObjectSizer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.geode.cache.util</div>
<h2 title="Interface ObjectSizer" class="title">Interface ObjectSizer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">ObjectSizer</span></pre>
<div class="block">The sizer interface defines a method that when called returns the size of the object passed in.
Implementations may return hardcoded values for object size if the implementation knows the
object size for all objects that are likely to be cached.
You should use a sizer with a <a href="../../../../../org/apache/geode/cache/EvictionAttributes.html#createLRUHeapAttributes-org.apache.geode.cache.util.ObjectSizer-"><code>EvictionAttributes.createLRUHeapAttributes(ObjectSizer)</code></a> or
<a href="../../../../../org/apache/geode/cache/EvictionAttributes.html#createLRUMemoryAttributes-org.apache.geode.cache.util.ObjectSizer-"><code>EvictionAttributes.createLRUMemoryAttributes(ObjectSizer)</code></a> if you want to use a faster or
more accurate method of sizing than provided by the default object sizer, which is
<a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#SIZE_CLASS_ONCE"><code>SIZE_CLASS_ONCE</code></a></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 3.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util">ObjectSizer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#DEFAULT">DEFAULT</a></span></code>
<div class="block">The default object sizer, currently <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#SIZE_CLASS_ONCE"><code>SIZE_CLASS_ONCE</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util">ObjectSizer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#REFLECTION_SIZE">REFLECTION_SIZE</a></span></code>
<div class="block">An implementation of <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util"><code>ObjectSizer</code></a> that calculates an accurate size for each object that
it sizes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util">ObjectSizer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#SIZE_CLASS_ONCE">SIZE_CLASS_ONCE</a></span></code>
<div class="block">An implementation of <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util"><code>ObjectSizer</code></a> that calculates an accurate size of the first instance
of each class that is put in the cache.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#sizeof-java.lang.Object-">sizeof</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;o)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="SIZE_CLASS_ONCE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SIZE_CLASS_ONCE</h4>
<pre><a href="../../../../../org/apache/geode/annotations/Immutable.html" title="annotation in org.apache.geode.annotations">@Immutable</a>
static final&nbsp;<a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util">ObjectSizer</a> SIZE_CLASS_ONCE</pre>
<div class="block">An implementation of <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util"><code>ObjectSizer</code></a> that calculates an accurate size of the first instance
of each class that is put in the cache. After the first instance, it will return the same size
for every instance of that class.
This sizer is a compromise between generating accurate sizes for every object and performance.
It should work well if the keys and values in the region don't vary greatly in size. For
accurate sizing of every instance use <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#REFLECTION_SIZE"><code>REFLECTION_SIZE</code></a> instead.
This sizer does generate an accurate size for strings and byte arrays every time, because there
is very little performance impact from sizing these objects.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 6.5</dd>
</dl>
</li>
</ul>
<a name="REFLECTION_SIZE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>REFLECTION_SIZE</h4>
<pre><a href="../../../../../org/apache/geode/annotations/Immutable.html" title="annotation in org.apache.geode.annotations">@Immutable</a>
static final&nbsp;<a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util">ObjectSizer</a> REFLECTION_SIZE</pre>
<div class="block">An implementation of <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util"><code>ObjectSizer</code></a> that calculates an accurate size for each object that
it sizes.
This sizer will add up the sizes of all objects that are reachable from the keys and values in
your region by non-static fields.
For objects that are all approximately the same size, consider using <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#SIZE_CLASS_ONCE"><code>SIZE_CLASS_ONCE</code></a>.
It will have much better performance.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 6.5</dd>
</dl>
</li>
</ul>
<a name="DEFAULT">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT</h4>
<pre><a href="../../../../../org/apache/geode/annotations/Immutable.html" title="annotation in org.apache.geode.annotations">@Immutable</a>
static final&nbsp;<a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html" title="interface in org.apache.geode.cache.util">ObjectSizer</a> DEFAULT</pre>
<div class="block">The default object sizer, currently <a href="../../../../../org/apache/geode/cache/util/ObjectSizer.html#SIZE_CLASS_ONCE"><code>SIZE_CLASS_ONCE</code></a></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 6.5</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="sizeof-java.lang.Object-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>sizeof</h4>
<pre>int&nbsp;sizeof(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;o)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/geode/cache/util/GatewayEvent.html" title="interface in org.apache.geode.cache.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/geode/cache/util/RegionMembershipListenerAdapter.html" title="class in org.apache.geode.cache.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/geode/cache/util/ObjectSizer.html" target="_top">Frames</a></li>
<li><a href="ObjectSizer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>