Let's say 100 clients for 40 beans (good site if you have 100 clients at the
*same* time) that means 4000 beans in memory at one time...
we drive jboss to 150,000 beans in memory in one cache (and so did you up to
161,000 if I remember correctly) with no problem.
So you can safely set the cache to hold max 4000 over the different caches
(100 per) bump up your number I believe it is pretty safe and you won't be
limited under "load" you will see liner performance.
marc
__________________________
" I am so excited ...
that I just can't hide it"
-- some techno song--
__________________________
|-----Original Message-----
|From: [EMAIL PROTECTED]
|[mailto:[EMAIL PROTECTED]]On Behalf Of Hayden, Ty
|Sent: Wednesday, October 25, 2000 12:21 PM
|To: 'jBoss'
|Subject: RE: [jBoss-User] Out of memory Bug STILL??
|
|
|Marc or any other JBoss Guru,
|
|That was the problem, but took me a while to configure it, because of lack
|of documentation
|and or examples on how to configure the LRU enterprise Context
|Cache Policy.
|My next question is...
|
|What is a good optimal setting for the LRU Cache? I have about 40 entity
|beans deployed. My settings are below. Should I be asking Simone Boredet
|since thats who implemented the plugin?
|
| <container-configurations>
| <container-configuration>
| <container-name>K2</container-name>
| <call-logging>false</call-logging>
|
|<container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContaine
|rInvoker<
|/container-invoker>
|
|<instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
|
|<instance-cache>org.jboss.ejb.plugins.EntityInstanceCache</instance-cache>
|
|<persistence-manager>org.jboss.ejb.plugins.BMPPersistenceManager</p
|ersistenc
|e-manager>
|
|<transaction-manager>org.jboss.tm.TxManager</transaction-manager>
| <container-invoker-conf>
| <RMIObjectPort>4444</RMIObjectPort>
| <Optimized>True</Optimized>
| </container-invoker-conf>
| <container-cache-conf>
|
|<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy
|</cache-p
|olicy>
| <cache-policy-conf>
| <min-capacity>10</min-capacity>
| <max-capacity>50</max-capacity>
| <overager-period>10</overager-period>
| <resizer-period>10</resizer-period>
| <max-bean-age>5</max-bean-age>
|
|<max-cache-miss-period>10</max-cache-miss-period>
|
|<min-cache-miss-period>10</min-cache-miss-period>
| <cache-load-factor>.3</cache-load-factor>
| </cache-policy-conf>
| </container-cache-conf>
| <container-pool-conf>
| <MaximumSize>100</MaximumSize>
| <MinimumSize>10</MinimumSize>
| </container-pool-conf>
| <commit-option>A</commit-option>
|
| </container-configuration>
| </container-configurations>
|
|
|
|
|
|
|-----Original Message-----
|From: marc fleury [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, October 24, 2000 5:52 PM
|To: jBoss
|Subject: RE: [jBoss-User] Out of memory Bug STILL??
|
|
|hey are you using a passivating cache?
|
|if not everyone is in memory...
|
|marc
|
|
||-----Original Message-----
||From: [EMAIL PROTECTED]
||[mailto:[EMAIL PROTECTED]]On Behalf Of Hayden, Ty
||Sent: Tuesday, October 24, 2000 2:16 PM
||To: 'jBoss'
||Subject: [jBoss-User] Out of memory Bug STILL??
||
||
||
||Hey Everyone,
||
||I just upgraded to Beta-Prod 3 and still having Out of memory
|exceptions on
||the server side. To test to see if I didn't have memory leaks in my own
||beans, I completely scraped those and created a dummy Entity Bean
||- attached
||below - Using BMP but just ignoring the ejbSaves / ejbCreate and not
||persisting anything. If I create upwards of 150,000 objects from clients
||and I get OOM on the server i.e.:
||
||[TestingHome] --Create--167657
||[TestingHome] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is:
|| java.lang.OutOfMemoryError
||[TestingHome] java.lang.OutOfMemoryError
||[TestingHome] <<no stack trace available>>
||
||
||
||My bean has a sample main client build in so you can see what I
|am doing...
||Is there a setting somewhere on the max number of cached objects???
||
||
||public class TestingBean implements EntityBean {
||
|| public int cnt = 0;
||
|| /**
|| * Retrieve id
|| */
|| public int getCount() throws RemoteException {
|| return (int)id;
|| }
||
|| /**
|| * Get string test
|| *
|| * @parm s - string to retrieve
|| */
|| public String getStr() throws RemoteException {
|| return id+"";
|| }
||
||
|| long id = 0;
||
|| static long _cnt = 1000;
|| public String ejbCreate() throws RemoteException {
|| id = _cnt++;
|| System.out.println("--Create--" + id);
|| return id+"";
|| }
|| public void ejbPostCreate() throws RemoteException {
|| System.out.println("--PostCreate--" + id);
|| }
||
|| public void ejbActivate() throws RemoteException {
|| System.out.println("--Activate--" + id);
|| }
|| public void ejbPassivate() throws RemoteException {
|| System.out.println("--Passivate--" + id);
|| }
|| public void ejbRemove() throws RemoteException {
|| System.out.println("--Remove--" + id);
|| }
||
|| public void ejbLoad() throws RemoteException {
|| String pk = (String) ((EntityContext)context).getPrimaryKey();
|| System.out.println("--Load--" + pk);
|| id = (new Long(pk)).longValue();
|| }
|| public void ejbStore() throws RemoteException {
|| String pk = (String) ((EntityContext)context).getPrimaryKey();
|| System.out.println("--Store--" + pk);
|| id = (new Long(pk)).longValue();
|| }
|| transient private EntityContext context;
||
|| public void setEntityContext(EntityContext ctx) throws
||RemoteException {
|| context = ctx;
|| }
||
|| public EntityContext getEntityContext() throws RemoteException {
|| return context;
|| }
|| public void unsetEntityContext() {
|| context = null;
|| }
|| public String ejbFindByPrimaryKey(String key) throws
||ObjectNotFoundException, FinderException {
|| return key;
|| }
|| public Enumeration ejbFindAllObjects() throws
|ObjectNotFoundException,
||FinderException {
|| return (new Vector()).elements();
|| }
|| public Enumeration ejbFindByQuery(String q) throws
||ObjectNotFoundException, FinderException {
|| return (new Vector()).elements();
|| }
||
||
|| public static Properties getBeanProps() {
|| Properties props = new Properties();
|| try
|
|| InputStream fin;
||
|| fin = new
|feredInputStream(
||
||ClassLoader.getSystemClassLoader().getSystemResourceAsStream("BeanC
||onfig.pro
||ps"));
||
|| props.load( fin );
|| fin.close();
|| } catch (Exception e) {
|| System.out.println(e);
|| }
|| return props;
|| }
||
|| public static void main(String args[]){
|| try {
|| Hashtable env = new Hashtable();
|| Properties p = getBeanProps();
|| env.put("java.naming.provider.
|url","localhost:1099");
|| env.put("java.naming.factory.initial",
||p.getProperty("java.naming.factory.initial",""));
|| env.put("java.naming.factory.url.pkgs",
||p.getProperty("java.naming.factory.url.pkgs","") );
|| Context initialContext = new InitialContext(env);
||
|| TestingHome server = (TestingHome)
||initialContext.lookup("TestingHome");
|| int max = 5000;
|| try {
|| max = (new Integer( args[0] )).intValue();
|| } catch (Exception e) {}
||
|| Vector v = new Vector();
|| System.out.println("Creating " + max + " Test beans.");
|| for(int i=0;i<max;i++) {
|| v.add( server.create().getPrimaryKey() );
|| }
|| System.out.println("Finding " + max
+ " Test beans.");
|| for(int i=0;i<max;i++) {
|| server.findByPrimaryKey( (String) v.elementAt(i) );
|| }
||
|| System.out.println("Executing method " + max + " Test beans.");
|| for(int i=0;i<max;i++) {
|| server.findByPrimaryKey( (String) v.elementAt(i) ).getCount();
|| }
||
|| System.out.println("Removing " + max + " Test beans.");
|| for(int i=0;i<max;i++) {
|| server.findByPrimaryKey( (String) v.elementAt(i) ).remove();
|| }
|| } catch (Exception e2) {
|| System.out.println(e2);
|| }
||
|| }
||}
||
||
||
||--
||--------------------------------------------------------------
||To subscribe: [EMAIL PROTECTED]
||To unsubscribe: [EMAIL PROTECTED]
||Problems?: [EMAIL PROTECTED]
||
||
|
|
|
|--
|--------------------------------------------------------------
|To subscribe: [EMAIL PROTECTED]
|To unsubscribe: [EMAIL PROTECTED]
|Problems?: [EMAIL PROTECTED]
|
|
|--
|--------------------------------------------------------------
|To subscribe: [EMAIL PROTECTED]
|To unsubscribe: [EMAIL PROTECTED]
|Problems?: [EMAIL PROTECTED]
|
|
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]