<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.NormalWeb1, li.NormalWeb1, div.NormalWeb1
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle19
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I believe that I have a working first
draft. What’s the usual approach for putting it out there so folks can comment?
Shall I upload a patch to the JIRA issue or do most of you look at the
clone/fork on GitHub?</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-- </span></font><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Dave</span></font><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'> Marion</span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
infinispan-dev-bounces@lists.jboss.org
[mailto:infinispan-dev-bounces@lists.jboss.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>david marion<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, January 20, 2011
7:53 AM<br>
<b><span style='font-weight:bold'>To:</span></b> infinispan-dev@lists.jboss.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [infinispan-dev] ISPN-863
- Thoughts / Questions</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>I did exactly that last night. I
built a test that allocated HashEntry<K,V>[] just like it does
in the Segment constructor. I don't have the numbers in front of me
right now, but at the maximum size (2^30) and without specifying
concurrency it was trying to allocate 32 Segment objects each
having a HashEntry<K,V>[] with 2^25 elements. Each one of these
HashEntry<K,V>[] takes up around 128MB of memory.<br>
<br>
> From: galder@redhat.com<br>
> Date: Thu, 20 Jan 2011 09:38:43 +0100<br>
> To: infinispan-dev@lists.jboss.org<br>
> Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<br>
> <br>
> <br>
> On Jan 19, 2011, at 1:47 PM, david marion wrote:<br>
> <br>
> > <br>
> > It was my problem. If -1 is set for maxEntries, then I am creating a
BoundedConcurrentHashMap with a size of Integer.MAX_VALUE. Then when I ran the
tests all of them ran out of memory. I should have looked at the stack trace a
little more closely. I am going to have to put logic in so that the maximum
capacity is determined by the amount of free memory when the cache is created.
Previously, if -1 was set for maxEntries, a ConcurrentHashMap was created with
maximum capacity of Integer.MAX_VALUE. I have not looked at the code, but my
guess is that it works because it grows over time and does not pre-allocate all
structures ahead of time.<br>
> <br>
> Hmmm, that sounds odd. Maybe you wanna build a test to show the exact
differences and see if too much is being allocated on startup?<br>
> <br>
> > Any thoughts on logic for determining maximum capacity at creation
time? <br>
> <br>
> A percentage of the available free memory? 40% by default? You have to
accomodate for the other apps running on the same JVM, so we shouldn't be too
aggressive by default.<br>
> <br>
> > <br>
> > > From: galder@redhat.com<br>
> > > Date: Wed, 19 Jan 2011 10:32:42 +0100<br>
> > > To: infinispan-dev@lists.jboss.org<br>
> > > Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<br>
> > > <br>
> > > Out of curiosity, what is a code problem on your side? Or a set
up issue?<br>
> > > <br>
> > > On Jan 19, 2011, at 4:29 AM, david marion wrote:<br>
> > > <br>
> > > > Disregard, I found the issue. Sorry for the spam.<br>
> > > > <br>
> > > > > From: dlmarion@hotmail.com<br>
> > > > > To: infinispan-dev@lists.jboss.org<br>
> > > > > Date: Tue, 18 Jan 2011 20:39:21 -0500<br>
> > > > > Subject: Re: [infinispan-dev] ISPN-863 - Thoughts /
Questions<br>
> > > > > <br>
> > > > > Hah, might be because the POM is configured to run
tests in parallel with a<br>
> > > > > max heap size of 1GB. Can someone update<br>
> > > > > http://community.jboss.org/wiki/ParallelTestSuite or<br>
> > > > > http://community.jboss.org/wiki/InfinispanQuickStartGuideforDevelopers#Testi<br>
> > > > > ng with instructions on how to run test serially (I
didn’t find anything wrt<br>
> > > > > Maven surefire plugin)? Thanks<br>
> > > > > <br>
> > > > > -----Original Message-----<br>
> > > > > From: infinispan-dev-bounces@lists.jboss.org<br>
> > > > > [mailto:infinispan-dev-bounces@lists.jboss.org] On
Behalf Of Galder<br>
> > > > > Zamarreņo<br>
> > > > > Sent: Tuesday, January 18, 2011 6:12 AM<br>
> > > > > To: infinispan -Dev List<br>
> > > > > Subject: Re: [infinispan-dev] ISPN-863 - Thoughts /
Questions<br>
> > > > > <br>
> > > > > Hmmm, try increasing -Xmx? Start with
-XX:+HeapDumpOnOutOfMemoryError<br>
> > > > > -XX:HeapDumpPath=/tmp/java_heap and inspect the dump
with Eclipse MAT?...<br>
> > > > > <br>
> > > > > On Jan 17, 2011, at 4:51 PM, david marion wrote:<br>
> > > > > <br>
> > > > > > same result.<br>
> > > > > > <br>
> > > > > > Date: Mon, 17 Jan 2011 11:54:15 -0300<br>
> > > > > > From: vblagoje@redhat.com<br>
> > > > > > To: infinispan-dev@lists.jboss.org<br>
> > > > > > Subject: Re: [infinispan-dev] ISPN-863 - Thoughts
/ Questions<br>
> > > > > > <br>
> > > > > > Its easier to run everything from command line
for two reason I can think<br>
> > > > > of:<br>
> > > > > > - everyone has same env to compare results with
you<br>
> > > > > > - it is all ready to go<br>
> > > > > > <br>
> > > > > > See http://community.jboss.org/wiki/InfinispanandMaven<br>
> > > > > > <br>
> > > > > > On 11-01-17 11:38 AM, Dave wrote:<br>
> > > > > > All,<br>
> > > > > > <br>
> > > > > > I am trying to test some changes that I made
using Eclipse and the TestNG<br>
> > > > > plugin. I am not familiar with TestNG. Are there any
settings that I should<br>
> > > > > make? Any ideas?<br>
> > > > > > <br>
> > > > > > java.lang.OutOfMemoryError: Java heap space<br>
> > > > > > at<br>
> > > > >
org.infinispan.util.concurrent.BoundedConcurrentHashMap$HashEntry.newArray(B<br>
> > > > > oundedConcurrentHashMap.java:295)<br>
> > > > > > at<br>
> > > > >
org.infinispan.util.concurrent.BoundedConcurrentHashMap$Segment.<init>(Bound<br>
> > > > > edConcurrentHashMap.java:898)<br>
> > > > > > at<br>
> > > > >
org.infinispan.util.concurrent.BoundedConcurrentHashMap.<init>(BoundedConcur<br>
> > > > > rentHashMap.java:1367)<br>
> > > > > > at<br>
> > > > >
org.infinispan.container.DefaultDataContainer.<init>(DefaultDataContainer.ja<br>
> > > > > va:78)<br>
> > > > > > at<br>
> > > > >
org.infinispan.container.DefaultDataContainer.<init>(DefaultDataContainer.ja<br>
> > > > > va:47)<br>
> > > > > > at<br>
> > > > >
org.infinispan.container.DefaultDataContainer.unBoundedDataContainer(Default<br>
> > > > > DataContainer.java:93)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.DataContainerFactory.construct(DataContainerFactory<br>
> > > > > .java:53)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(Abst<br>
> > > > > ractComponentRegistry.java:315)<br>
> > > > > > at<br>
> > > > > org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(Abs<br>
> > > > > tractComponentRegistry.java:251)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry$Component.injectDependenc<br>
> > > > > ies(AbstractComponentRegistry.java:840)<br>
> > > > > > at<br>
> > > > > org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<br>
> > > > > tComponentRegistry.java:225)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegist<br>
> > > > > ry.java:120)<br>
> > > > > > at<br>
> > > > > org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<br>
> > > > > tComponentRegistry.java:192)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(Abst<br>
> > > > > ractComponentRegistry.java:323)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(Abs<br>
> > > > > tractComponentRegistry.java:251)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry$Component.injectDependenc<br>
> > > > > ies(AbstractComponentRegistry.java:840)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<br>
> > > > > tComponentRegistry.java:225)<br>
> > > > > > at<br>
> > > > > org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegist<br>
> > > > > ry.java:120)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<br>
> > > > > tComponentRegistry.java:192)<br>
> > > > > > at<br>
> > > > > org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(Abst<br>
> > > > > ractComponentRegistry.java:323)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(Abs<br>
> > > > > tractComponentRegistry.java:251)<br>
> > > > > > at<br>
> > > > > org.infinispan.factories.AbstractComponentRegistry$Component.injectDependenc<br>
> > > > > ies(AbstractComponentRegistry.java:840)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<br>
> > > > > tComponentRegistry.java:225)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegist<br>
> > > > > ry.java:120)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<br>
> > > > > tComponentRegistry.java:192)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.InternalCacheFactory.bootstrap(InternalCacheFactory<br>
> > > > > .java:92)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.InternalCacheFactory.createAndWire(InternalCacheFac<br>
> > > > > tory.java:78)<br>
> > > > > > at<br>
> > > > >
org.infinispan.factories.InternalCacheFactory.createCache(InternalCacheFacto<br>
> > > > > ry.java:62)<br>
> > > > > > at<br>
> > > > >
org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.j<br>
> > > > > ava:510)<br>
> > > > > > at<br>
> > > > >
org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java<br>
> > > > > :440)<br>
> > > > > > at<br>
> > > > >
org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java<br>
> > > > > :409)<br>
> > > > > > at<br>
> > > > >
org.infinispan.config.ConfigurationValidationTest.testDefaultMemoryGuardConf<br>
> > > > > iguration(ConfigurationValidationTest.java:100)<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > <br>
> > > > > > -----Original Message-----<br>
> > > > > > From: infinispan-dev-bounces@lists.jboss.org<br>
> > > > > [mailto:infinispan-dev-bounces@lists.jboss.org] On
Behalf Of Vladimir<br>
> > > > > Blagojevic<br>
> > > > > > Sent: Friday, January 14, 2011 11:05 AM<br>
> > > > > > To: infinispan -Dev List<br>
> > > > > > Subject: Re: [infinispan-dev] ISPN-863 - Thoughts
/ Questions<br>
> > > > > > <br>
> > > > > > Hey David,<br>
> > > > > > <br>
> > > > > > First of all kudos for taking on such a
non-trivial task!<br>
> > > > > > <br>
> > > > > > On 11-01-14 12:22 AM, david marion wrote:<br>
> > > > > > 1. Modify configuration in some way so that the
following can be<br>
> > > > > specified:<br>
> > > > > > a. The percentage value of used JVM memory (i.e.
95) at which<br>
> > > > > entries should be evicted to try and avoid an OOM
error.<br>
> > > > > > b. The number of items that should be evicted when
memory reaches<br>
> > > > > this threshold<br>
> > > > > > 2. Modify LRU and LIRS Eviction class so that the
accessQueue member<br>
> > > > > can be accessed by the new Eviction class so that two
access queues don’t<br>
> > > > > have to be maintained.<br>
> > > > > > 3. Create a new Eviction class, a subclass of
LIRS, where the<br>
> > > > > accessQueue is used from the Eviction strategy the
user specifies and the<br>
> > > > > for loop in the execute method is exited when the
evicted set equals value<br>
> > > > > from 1.b above.<br>
> > > > > > 4. Modify DataContainerFactory.construct() to
call<br>
> > > > > DefaultDataContainer.boundedDataContainer() regardless
of eviction policy.<br>
> > > > > This will always create a BoundedConcurrentHashMap<br>
> > > > > > <br>
> > > > > > I don't think you have to extend LRU and LIRS, as
long as you implement<br>
> > > > > EvictionPolicy you are fullfilling the contract. What
extending LRU and LIRS<br>
> > > > > can do is give you some order in selecting proper
elements for eviction. I<br>
> > > > > think the precise technical term in research
literature is "eviction<br>
> > > > > precision". <br>
> > > > > > <br>
> > > > > > <br>
> > > > > > 1. <br>
> > > > > > 2. Create an instance of the new Eviction class
in each segment.<br>
> > > > > > 3. Modify BoundedConcurrentHashMap.Segment put
and replace methods<br>
> > > > > such that when new values are going to be put into the
Segment, the memory<br>
> > > > > usage is checked and the execute method is called on
the new Eviction class.<br>
> > > > > > <br>
> > > > > > Sounds right!<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > 1. <br>
> > > > > > <br>
> > > > > > Questions:<br>
> > > > > > <br>
> > > > > > 1. What are the implications of using a
BoundedConcurrentHashMap<br>
> > > > > instead of a ConcurrentHashMap when maxEntries is set
to -1?<br>
> > > > > > <br>
> > > > > > I think none except you turn on eviction by using<br>
> > > > > BoundedConcurrentHashMap.<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > 1. <br>
> > > > > > <br>
> > > > > > Thoughts<br>
> > > > > > <br>
> > > > > > 1. This will not guarantee that an OOM error does
not occur. It will<br>
> > > > > attempt to guard against an OOM caused by putting new
values into the cache.<br>
> > > > > This will probably be more effective when the cache is
being used in<br>
> > > > > client/server mode, and less effective when used in
embedded mode as to<br>
> > > > > other code running in the JVM.<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > -- Dave Marion<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > Cheers,<br>
> > > > > > Vladimir<br>
> > > > > > <br>
> > > > > > _______________________________________________<br>
> > > > > > infinispan-dev mailing list<br>
> > > > > > <br>
> > > > > > infinispan-dev@lists.jboss.org<br>
> > > > > >
https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > _______________________________________________
infinispan-dev mailing<br>
> > > > > list infinispan-dev@lists.jboss.org<br>
> > > > >
https://lists.jboss.org/mailman/listinfo/infinispan-dev_____________________<br>
> > > > > __________________________<br>
> > > > > > infinispan-dev mailing list<br>
> > > > > > infinispan-dev@lists.jboss.org<br>
> > > > > > https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> > > > > <br>
> > > > > --<br>
> > > > > Galder Zamarreņo<br>
> > > > > Sr. Software Engineer<br>
> > > > > Infinispan, JBoss Cache<br>
> > > > > <br>
> > > > > <br>
> > > > > _______________________________________________<br>
> > > > > infinispan-dev mailing list<br>
> > > > > infinispan-dev@lists.jboss.org<br>
> > > > >
https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> > > > > <br>
> > > > > <br>
> > > > > _______________________________________________<br>
> > > > > infinispan-dev mailing list<br>
> > > > > infinispan-dev@lists.jboss.org<br>
> > > > >
https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> > > > _______________________________________________<br>
> > > > infinispan-dev mailing list<br>
> > > > infinispan-dev@lists.jboss.org<br>
> > > > https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> > > <br>
> > > --<br>
> > > Galder Zamarreņo<br>
> > > Sr. Software Engineer<br>
> > > Infinispan, JBoss Cache<br>
> > > <br>
> > > <br>
> > > _______________________________________________<br>
> > > infinispan-dev mailing list<br>
> > > infinispan-dev@lists.jboss.org<br>
> > > https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> > _______________________________________________<br>
> > infinispan-dev mailing list<br>
> > infinispan-dev@lists.jboss.org<br>
> > https://lists.jboss.org/mailman/listinfo/infinispan-dev<br>
> <br>
> --<br>
> Galder Zamarreņo<br>
> Sr. Software Engineer<br>
> Infinispan, JBoss Cache<br>
> <br>
> <br>
> _______________________________________________<br>
> infinispan-dev mailing list<br>
> infinispan-dev@lists.jboss.org<br>
> https://lists.jboss.org/mailman/listinfo/infinispan-dev</span></font></p>
</div>
</body>
</html>