<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<P style="MARGIN: 0in 0in 0pt" class=MsoPlainText><FONT face="Courier New">It took me some time to figure out how to use Git and add some more tests. I have pushed my changes to a topic branch located at <A href="https://github.com/dlmarion/infinispan/tree/ISPN-863-master">https://github.com/dlmarion/infinispan/tree/ISPN-863-master</A></FONT><FONT face="Courier New">. </FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoPlainText><FONT face="Courier New">Please let me know if you have any questions or concerns. I have put up some documentation at <A href="https://github.com/dlmarion/infinispan/wiki/ISPN-863-Implementation">https://github.com/dlmarion/infinispan/wiki/ISPN-863-Implementation</A></FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoPlainText><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoPlainText><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoPlainText><FONT face="Courier New">-- Dave Marion<o:p></o:p></FONT></P>
<BR>&nbsp;<BR>
&gt; From: galder@redhat.com<BR>&gt; Date: Tue, 25 Jan 2011 12:11:28 +0100<BR>&gt; To: infinispan-dev@lists.jboss.org<BR>&gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; <BR>&gt; Clone the repo, make your changes in a topic branch and the send a pull request:<BR>&gt; <BR>&gt; http://community.jboss.org/docs/DOC-16089<BR>&gt; <BR>&gt; On Jan 25, 2011, at 3:03 AM, Dave wrote:<BR>&gt; <BR>&gt; &gt; 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?<BR>&gt; &gt; <BR>&gt; &gt; -- Dave Marion<BR>&gt; &gt; <BR>&gt; &gt; -----Original Message-----<BR>&gt; &gt; From: infinispan-dev-bounces@lists.jboss.org [mailto:infinispan-dev-bounces@lists.jboss.org] On Behalf Of david marion<BR>&gt; &gt; Sent: Thursday, January 20, 2011 7:53 AM<BR>&gt; &gt; To: infinispan-dev@lists.jboss.org<BR>&gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; <BR>&gt; &gt; I did exactly that last night. I built a test that allocated HashEntry&lt;K,V&gt;[] 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&lt;K,V&gt;[] with 2^25 elements. Each one of these HashEntry&lt;K,V&gt;[] takes up around 128MB of memory.<BR>&gt; &gt; <BR>&gt; &gt; &gt; From: galder@redhat.com<BR>&gt; &gt; &gt; Date: Thu, 20 Jan 2011 09:38:43 +0100<BR>&gt; &gt; &gt; To: infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; On Jan 19, 2011, at 1:47 PM, david marion wrote:<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; 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>&gt; &gt; &gt; <BR>&gt; &gt; &gt; 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>&gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; Any thoughts on logic for determining maximum capacity at creation time? <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; 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>&gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; From: galder@redhat.com<BR>&gt; &gt; &gt; &gt; &gt; Date: Wed, 19 Jan 2011 10:32:42 +0100<BR>&gt; &gt; &gt; &gt; &gt; To: infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; Out of curiosity, what is a code problem on your side? Or a set up issue?<BR>&gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; On Jan 19, 2011, at 4:29 AM, david marion wrote:<BR>&gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; Disregard, I found the issue. Sorry for the spam.<BR>&gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; From: dlmarion@hotmail.com<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; To: infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Date: Tue, 18 Jan 2011 20:39:21 -0500<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Hah, might be because the POM is configured to run tests in parallel with a<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; max heap size of 1GB. Can someone update<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; http://community.jboss.org/wiki/ParallelTestSuite or<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; http://community.jboss.org/wiki/InfinispanQuickStartGuideforDevelopers#Testi<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ng with instructions on how to run test serially (I didn’t find anything wrt<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Maven surefire plugin)? Thanks<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; -----Original Message-----<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; From: infinispan-dev-bounces@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; [mailto:infinispan-dev-bounces@lists.jboss.org] On Behalf Of Galder<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Zamarreño<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Sent: Tuesday, January 18, 2011 6:12 AM<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; To: infinispan -Dev List<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Hmmm, try increasing -Xmx? Start with -XX:+HeapDumpOnOutOfMemoryError<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; -XX:HeapDumpPath=/tmp/java_heap and inspect the dump with Eclipse MAT?...<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; On Jan 17, 2011, at 4:51 PM, david marion wrote:<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; same result.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Date: Mon, 17 Jan 2011 11:54:15 -0300<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; From: vblagoje@redhat.com<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; To: infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Its easier to run everything from command line for two reason I can think<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; of:<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; - everyone has same env to compare results with you<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; - it is all ready to go<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; See http://community.jboss.org/wiki/InfinispanandMaven<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; On 11-01-17 11:38 AM, Dave wrote:<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; All,<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I am trying to test some changes that I made using Eclipse and the TestNG<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; plugin. I am not familiar with TestNG. Are there any settings that I should<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; make? Any ideas?<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; java.lang.OutOfMemoryError: Java heap space<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.util.concurrent.BoundedConcurrentHashMap$HashEntry.newArray(B<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; oundedConcurrentHashMap.java:295)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.util.concurrent.BoundedConcurrentHashMap$Segment.&lt;init&gt;(Bound<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; edConcurrentHashMap.java:898)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.util.concurrent.BoundedConcurrentHashMap.&lt;init&gt;(BoundedConcur<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; rentHashMap.java:1367)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.container.DefaultDataContainer.&lt;init&gt;(DefaultDataContainer.ja<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; va:78)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.container.DefaultDataContainer.&lt;init&gt;(DefaultDataContainer.ja<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; va:47)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.container.DefaultDataContainer.unBoundedDataContainer(Default<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; DataContainer.java:93)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.DataContainerFactory.construct(DataContainerFactory<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; .java:53)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(Abst<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ractComponentRegistry.java:315)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(Abs<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tractComponentRegistry.java:251)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry$Component.injectDependenc<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ies(AbstractComponentRegistry.java:840)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tComponentRegistry.java:225)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegist<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ry.java:120)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tComponentRegistry.java:192)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(Abst<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ractComponentRegistry.java:323)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(Abs<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tractComponentRegistry.java:251)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry$Component.injectDependenc<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ies(AbstractComponentRegistry.java:840)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tComponentRegistry.java:225)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegist<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ry.java:120)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tComponentRegistry.java:192)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(Abst<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ractComponentRegistry.java:323)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(Abs<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tractComponentRegistry.java:251)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry$Component.injectDependenc<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ies(AbstractComponentRegistry.java:840)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tComponentRegistry.java:225)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.ComponentRegistry.registerComponent(ComponentRegist<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ry.java:120)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.AbstractComponentRegistry.registerComponent(Abstrac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tComponentRegistry.java:192)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.InternalCacheFactory.bootstrap(InternalCacheFactory<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; .java:92)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.InternalCacheFactory.createAndWire(InternalCacheFac<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; tory.java:78)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.factories.InternalCacheFactory.createCache(InternalCacheFacto<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ry.java:62)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.j<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; ava:510)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; :440)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; :409)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; at<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; org.infinispan.config.ConfigurationValidationTest.testDefaultMemoryGuardConf<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; iguration(ConfigurationValidationTest.java:100)<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; -----Original Message-----<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; From: infinispan-dev-bounces@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; [mailto:infinispan-dev-bounces@lists.jboss.org] On Behalf Of Vladimir<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Blagojevic<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Sent: Friday, January 14, 2011 11:05 AM<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; To: infinispan -Dev List<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Hey David,<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; First of all kudos for taking on such a non-trivial task!<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; On 11-01-14 12:22 AM, david marion wrote:<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. Modify configuration in some way so that the following can be<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; specified:<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; a. The percentage value of used JVM memory (i.e. 95) at which<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; entries should be evicted to try and avoid an OOM error.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; b. The number of items that should be evicted when memory reaches<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; this threshold<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 2. Modify LRU and LIRS Eviction class so that the accessQueue member<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; can be accessed by the new Eviction class so that two access queues don’t<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; have to be maintained.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 3. Create a new Eviction class, a subclass of LIRS, where the<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; accessQueue is used from the Eviction strategy the user specifies and the<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; for loop in the execute method is exited when the evicted set equals value<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; from 1.b above.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 4. Modify DataContainerFactory.construct() to call<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; DefaultDataContainer.boundedDataContainer() regardless of eviction policy.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; This will always create a BoundedConcurrentHashMap<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I don't think you have to extend LRU and LIRS, as long as you implement<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; EvictionPolicy you are fullfilling the contract. What extending LRU and LIRS<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; can do is give you some order in selecting proper elements for eviction. I<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; think the precise technical term in research literature is "eviction<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; precision". <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 2. Create an instance of the new Eviction class in each segment.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 3. Modify BoundedConcurrentHashMap.Segment put and replace methods<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; such that when new values are going to be put into the Segment, the memory<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; usage is checked and the execute method is called on the new Eviction class.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Sounds right!<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Questions:<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. What are the implications of using a BoundedConcurrentHashMap<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; instead of a ConcurrentHashMap when maxEntries is set to -1?<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; I think none except you turn on eviction by using<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; BoundedConcurrentHashMap.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Thoughts<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; 1. This will not guarantee that an OOM error does not occur. It will<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; attempt to guard against an OOM caused by putting new values into the cache.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; This will probably be more effective when the cache is being used in<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; client/server mode, and less effective when used in embedded mode as to<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; other code running in the JVM.<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; -- Dave Marion<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Cheers,<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Vladimir<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________ infinispan-dev mailing<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; list infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev_____________________<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; __________________________<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; --<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Galder Zamarreño<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Sr. Software Engineer<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Infinispan, JBoss Cache<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; --<BR>&gt; &gt; &gt; &gt; &gt; Galder Zamarreño<BR>&gt; &gt; &gt; &gt; &gt; Sr. Software Engineer<BR>&gt; &gt; &gt; &gt; &gt; Infinispan, JBoss Cache<BR>&gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; --<BR>&gt; &gt; &gt; Galder Zamarreño<BR>&gt; &gt; &gt; Sr. Software Engineer<BR>&gt; &gt; &gt; Infinispan, JBoss Cache<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; infinispan-dev mailing list<BR>&gt; &gt; infinispan-dev@lists.jboss.org<BR>&gt; &gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>&gt; <BR>&gt; --<BR>&gt; Galder Zamarreño<BR>&gt; Sr. Software Engineer<BR>&gt; Infinispan, JBoss Cache<BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; infinispan-dev mailing list<BR>&gt; infinispan-dev@lists.jboss.org<BR>&gt; https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>                                               </body>
</html>