[jboss-jira] [JBoss JIRA] Commented: (JBCACHE-709) Out of memory problem

Ben Wang (JIRA) jira-events at jboss.com
Wed Jul 26 21:07:11 EDT 2006


    [ http://jira.jboss.com/jira/browse/JBCACHE-709?page=comments#action_12340148 ] 
            
Ben Wang commented on JBCACHE-709:
----------------------------------

Based on your config xml, you are still using eviction and the thread wakeup interval is 7200 seconds. This is not going to work. The reason is that before the eviction thread can kick in to process event, add/remove are counted as a separate event. So naturally, the event queue will fill up quickly (before it can process it and determine nothing needs to be done from the eviction side).

You can change it from 7200 to 1 and test it again.

> Out of memory problem
> ---------------------
>
>                 Key: JBCACHE-709
>                 URL: http://jira.jboss.com/jira/browse/JBCACHE-709
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 1.2.4SP2
>         Environment: Windows NT, Ecliplse IDE and Pentium 4 processor.
>            Reporter: Sudhakar Pandey
>         Assigned To: Manik Surtani
>            Priority: Critical
>         Attachments: TestMemoryLeak.java, TreeCache.xml
>
>
> Problem:
> ~~~~~~~
> While running the following testcase after entering 66666 records my system program is getting hang.
> Following is the description of program:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> I am putting some String object in TreeCache, accessing it and then removing it from the cache. I am doing this in a infinite loop. 
> Following is the eviction policy:
> ~~~~~~~~~~~~~~~~~~~~~~~
>         <attribute name="EvictionPolicyConfig">
>            <config>
>               <attribute name="wakeUpIntervalSeconds">72000</attribute>
>               <!-- Cache wide default -->
>               <region name="/_default_">
>               	<attribute name="maxNodes">500</attribute>
> 	          	<attribute name="timeToLiveSeconds">180</attribute>
> 			  	<!-- Maximum time an object is kept in cache regardless of idle time -->
> 			  	<attribute name="maxAgeSeconds">7200</attribute>
>               </region>
>               <!-- yodlee wide default -->
>               <region name="/com/yodlee">
>                 <attribute name="maxNodes">500</attribute>
> 	          	<attribute name="timeToLiveSeconds">180</attribute>
> 			  	<!-- Maximum time an object is kept in cache regardless of idle time -->
> 			  	<attribute name="maxAgeSeconds">7200</attribute>
>               </region>                          
>            </config>
>         </attribute>
> *IMPORTENT*: If I reduce the 'wakeUpIntervalSeconds' then there is no leak. However, I can reduce this time coz it eats up lots of CPU. 
> I have attached the Tree Cache Configuration xml file also.
> Program:
> ~~~~~~~
> public void testTreeCache(){
> 		TreeCache treeCache;
> 		try {
> 			treeCache = new TreeCache();
> 			treeCache.setCacheMode(TreeCache.LOCAL);
> 			
> 			// configure TreeCache
> 			PropertyConfigurator config = new PropertyConfigurator();  
> 			config.configure(treeCache, "com/yodlee/core/system/services/cacheservice/TreeCache.xml");
> 			
> 			treeCache.startService();			
> 			String identifier = "Test/MemoryLeak/";
> 			String key = "key";
> 			String value = "JBoss Cache is a product designed to cache frequently accessed Java objects in order to dramatically improve the performance of e-business applications. By eliminating unnecessary database access, JBoss Cache decreases network traffic and increases the scalability of applications.";
> 			for(int i=0;;i++)
> 			{
> 				System.out.println("Putting key=" + (key +i));
> 				treeCache.put(identifier, key +i, value);
> 				System.out.println(treeCache.get(identifier, key + i));
> 				System.out.println("Removing key=" + (key+i));
> 				treeCache.remove(identifier, key + i);			
> 				
> 			}
> 			//treeCache.stopService();
> 		} catch (Exception e) {
> 			MessageController.log(JBossCacheServiceImpl.class.getName(), 1,
> 					ExceptionHelper.getExceptionStackTrace(e),
> 					MessageController.FATAL);
> 			throw new CoreException(ExceptionHelper.getExceptionStackTrace(e));
> 		}
> 	}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list