<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
I should have been more specific, notification delivery is not guaranteed. From <A href="http://download.oracle.com/javase/6/docs/api/java/lang/management/MemoryPoolMXBean.html">http://download.oracle.com/javase/6/docs/api/java/lang/management/MemoryPoolMXBean.html</A>:<BR>
<BR>
"There is no guarantee about when the <TT>MemoryMXBean</TT> will emit a threshold notification and when the notification will be delivered. "<BR> <BR>
> Date: Fri, 14 Jan 2011 15:46:02 +0100<BR>> From: bban@redhat.com<BR>> To: infinispan-dev@lists.jboss.org<BR>> Subject: Re: [infinispan-dev] ISPN-863 - Thoughts / Questions<BR>> <BR>> <BR>> <BR>> On 1/14/11 3:32 PM, david marion wrote:<BR>> ><BR>> ><BR>> > I agree. There are two ways to determine what the memory usage is, polling or notifications. The notification mechanism is not guaranteed<BR>> <BR>> <BR>> Are you referring to MemoryMXBean / MemoryPoolMXBean ? What do you mean <BR>> by not guaranteed ? Are you suggesting the notfications are not <BR>> implemented by all JVM vendors ?<BR>> <BR>> <BR>> > so we could have a background thread that polls to determine whether or not the threshold has been passed. Then in the put and replace methods, it would be the cost of checking a boolean value.<BR>> <BR>> When notifications are available, we should use them, otherwise polling <BR>> would be fine, I guess.<BR>> <BR>> <BR>> -- <BR>> Bela Ban<BR>> Lead JGroups / Clustering Team<BR>> JBoss<BR>> _______________________________________________<BR>> infinispan-dev mailing list<BR>> infinispan-dev@lists.jboss.org<BR>> https://lists.jboss.org/mailman/listinfo/infinispan-dev<BR>                                            </body>
</html>