[JBoss Cache] - JBoss Cache - Memory Leak when many Fqn/nodes added in Cache
by Sathish
Sathish [http://community.jboss.org/people/sathish_06] created the discussion
"JBoss Cache - Memory Leak when many Fqn/nodes added in Cache"
To view the discussion, visit: http://community.jboss.org/message/617503#617503
--------------------------------------------------------------
All - Iam observing OOM in JBoss Cache, with below mentioned scenario. Would like to get suggestions/help on the approach that iam doing to over come the situation is correct or not. Here is the details on the problem,
Problem:- JBoss Cache - Memory Leak when many Fqn/nodes added in Cache using TreeCache.put() API
Explanation of the problem:- When adding new data in cache with new node in the tree, its causing memory leak.
Environment/Config settings:-
JBoss Cache Version:-JBossCache 1.2.4.SP2[ $Id: Version.java,v 1.5.2.1.4.3 2006/02/15 05:08:06 bstansberry Exp $]\
CacheMode:LOCAL
EvictionPolicy: LRUPolicy
Test Cache region - /testRegionX definition:-
<region name="/testRegionX">
<attribute name="maxNodes">1000</attribute>
<attribute name="timeToLiveSeconds">30</attribute>
<!-- Maximum time an object is kept in cache regardless of idle time -->
<attribute name="maxAgeSeconds">30</attribute>
</region>
In the test code, start adding new objects in the cache(treeCache.put(identifier, key , vo)) with different FQN/tree node, as shown below.
/testRegionX/a/b/ k1, v1
/testRegionX/a1/b1/ k2, v2
/testRegionX/a12b2/ k2, v3
.....
Snippet of the test code,
TreeCache treeCache;
try {
treeCache = new TreeCache();
treeCache.setCacheMode(TreeCache.LOCAL);
System.out.println("JBoss Cache Version:-" + treeCache.getVersion());
PropertyConfigurator config = new PropertyConfigurator();
config.configure(treeCache, "TreeCache.xml");
treeCache.startService();
String identifier_prefix = "/testRegionX";
String key_prefix = "key_01_";
for(long i=0;;i++)
{
String key = key_prefix + i;
String identifier = identifier_prefix + "/" + i + "/data/";
//String identifier = identifier_prefix;
System.out.println("Identifer = " + identifier);
DummyVO vo = new DummyVO();
System.out.println("Adding[Id=new node, Key=unique] - Key - " + key);
treeCache.put(identifier, key , vo);
//access the data from cache
treeCache.get(identifier, key);
//dont call remove
//treeCache.remove(identifier, key);
//System.out.println("cache.remove called");
}
//treeCache.stopService();
} catch (Exception e) {
e.printStackTrace();
}
Refer attached zip file contains complete Tree cache configuration(TreeCache.xml) and test code. Just point the jboss library location in the ant.properits file to run the test code.
Note that i dont call the tree.remove() to remove the cache data, instead let the Cache manager evict the object once it gets expired(configured expiry time to 30 seconds.).
Ran test with default JVM heap size, and reunning out of memory in the 50K iteration. Took JMap histo and noticed that below 2 objects are not releasing, Attached histo in text file.
C:\Documents and Settings\skandasa>jmap -histo:live 4508
num #instances #bytes class name
----------------------------------------------
1: 107609 16019856 [LEDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$Entry;
3: 107609 6026104 EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap
When I start adding new objects in the cache(treeCache.put(identifier, key , vo)) in the same tree node ('/testRegionX' ie., not creating new nodes in the tree, as shown below) then not observing this OOM problem.
/testRegionX/ k1, v1
/testRegionX/ k2, v2
/testRegionX/ k2, v3
.....
In other words, if i simply store data in cache as a Hashmap, without creating many tree nodes, then not observing OOM.
Any thoughts on this behaviour of the JBoss cache ? How can i get control over the OOM problem when adding new nodes in the tree cache ?
Please advice!
Thanks,
Sathish
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/617503#617503]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[JBoss Tools] - birt integration: b:param in popup/ajax not working
by u j
u j [http://community.jboss.org/people/bcn] created the discussion
"birt integration: b:param in popup/ajax not working"
To view the discussion, visit: http://community.jboss.org/message/632517#632517
--------------------------------------------------------------
I use JBoss Tools Birt Integeration in a RichFaces application.
It works fine in a normal page, but when I include the same code in a popup, I get the error:
10:33:54,187 SEVERE [org.jboss.tools.birt] (ajp-127.0.0.1-127.0.0.1-8009-1) the value of parameter estabId is invalid: org.eclipse.birt.core.exception.CoreException: Can not convert the value of to Integer type.
at org.eclipse.birt.core.data.DataTypeUtil.toInteger(DataTypeUtil.java:276) [org.eclipse.birt.runtime_3.7.1.v20110913-1734.jar:]
at org.jboss.tools.birt.servlet.JBossBirtServlet.stringToObject(JBossBirtServlet.java:183) [jboss-birt-servlet.jar:]
at org.jboss.tools.birt.servlet.JBossBirtServlet.evaluateParameterValues(JBossBirtServlet.java:142) [jboss-birt-servlet.jar:]
at org.jboss.tools.birt.servlet.JBossBirtServlet.doGet(JBossBirtServlet.java:108) [jboss-birt-servlet.jar:]
at org.jboss.tools.birt.servlet.JBossBirtServlet.doPost(JBossBirtServlet.java:123) [jboss-birt-servlet.jar:]
The jsf is:
<rich:popupPanel autosized="true" modal="false" domElementAttachment="form">
<b:birt embeddable="true" designName="rep.rptdesign" designType="embed">
<b:param name="estabId" value="#{bean.estabId}" />
</b:birt>
</rich:popupPanel>
I verified with the debugger that the bean get method is never called. It seems that on an ajax-request the b:param is not (re-)evaluated. The popup is opened via a a4j:commandLink with a render attribute pointing to the id of the popup.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/632517#632517]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months