[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: erezhara  XML
Profile for erezhara -> Messages posted by erezhara [57] Go to Page: 1, 2, 3, 4 Next 
Author Message
10x for the info.
Ok, i will try to use a synchronized block around the put loop.
is that what you mean in reduce the transaction?
generally, what i tried was:
Code:
 for(int i=10000;i<100000;i++)
  	cache.put("key"+i, ibpu.replicate("A", 1000));
 

so i can use fewer puts and add synchronized block?

they're undocumented, and you shouldn't change them. what problem are you running into?
 

i want to understand the logic and what these parameters mean.
and what do these mean?
- l2.cachemanager.leastCount - wha's that??
- l2.cachemanager.percentageToEvict - what's that??
- l2.cachemanager.criticalThreshold - what's that??
Ok, let's see if i got it:
- l1.cachemanager.threshold - heap utilization percent in which managed root eviction from memory will start
- l2.cachemanager.enabled - can be used to turn off caching
- l2.cachemanager.leastCount - wha's that??
- l2.cachemanager.percentageToEvict - what's that??
- l2.cachemanager.criticalThreshold - what's that??
- l1.cachemanager.logging.enabled - can be used to debug the process
i take it that these are undocumented parameters? if not, where is their documentation?
regarding l1.cachemanager.*
what do these properties mean? where are they documented?
i have tried the same test in batches of 10000 put() and got the same java.lang.OutOfMemoryError: Java heap space.

i used the following properties in tc.properties:
l1.cachemanager.threshold=50
l1.cachemanager.criticalThreshold=70
l1.cachemanager.percentageToEvict=10

1. what do these properties mean? where are they documented?

2.
If you lock on your Cache's put method, Terracotta will be able to evict already committed values, thus freeing up memory.
 

how exactly should that be done?
this test is about roots and not session replication, although session replication is also used.
please find the config file attached.
i have tried a simple test with virtual heap and got lots of java.lang.OutOfMemoryError: Java heap space.

i set the following properties in tc.properties:
l1.cachemanager.threshold=50
l1.cachemanager.criticalThreshold=70
l1.cachemanager.percentageToEvict=10

BTW, what's the meaning of the l1 prefix?

i used the following classes:
Code:
 package com.magicsoftware.ibolt.portal.test;
 
 public class CacheMngr
 {
 	private Cache mCache;
 	
 	public synchronized Cache getCache()
 	{
 		if (mCache == null)
 		{
 			System.out.println("Creating mCache..");
 			mCache = new Cache();
 		}
 		return mCache;
 	}
 }
 
 package com.magicsoftware.ibolt.portal.test;
 
 import java.util.HashMap;
 import java.util.Map;
 
 public class Cache
 {
 	private Map mItems=new HashMap();
 	
 	public Cache()
 	{
 		System.out.println("Cache created..");
 	}
 	
 	public void put(String key, String val)
 	{
 		mItems.put(key, val);
 	}
 	
 	public String get(String key)
 	{
 		return (String)mItems.get(key);
 	}
 	
 	public int size()
 	{
 		return mItems.size();
 	}
 }
 


and populated the Cache object in a loop from a jsp page:
Code:
 <%
 CacheMngr cacheMngr=(CacheMngr)application.getAttribute("CacheMngr");
 if(cacheMngr==null)
 {
 	cacheMngr= new CacheMngr();
 	application.setAttribute("CacheMngr", cacheMngr);
 }
 Cache cache=cacheMngr.getCache();
 for(int i=10000;i<100000;i++)
 	cache.put("key"+i, ibpu.replicate("A", 1000));
 %>
 


the jvm had 256MB heap and it used it all, and not just partly, as should have been with terracotta (see attached log).

where did i go wrong?
thanks,
where can i find some documentation on these properties?
here it is..
see <field-name>com.magicsoftware.ibolt.portal.test.CacheMngr.mCache</field-name>
i want to share the same class in the same field, i.e. only have ClassA:
com.mypackage.ClassA
Container myContainer = new Container();
ok,
i can do that.
so what should be different in the instances separate config files?
how would that achieve WAR separation?
i want to use virtual heap.
i managed to define a root and manage it using terracotta.
now, how do i config this root to use virtual heap, i.e. limit the size of memory it uses on the client jvm?
continued from http://forums.terracotta.org/forums/posts/list/364.page

how can i use multiple config files to get the same root managed separatly for two/more different WARs?
done :-)
http://jira.terracotta.org/jira/browse/CDV-371
 
Profile for erezhara -> Messages posted by erezhara [57] Go to Page: 1, 2, 3, 4 Next 
Go to:   
Powered by JForum 2.1.7 © JForum Team