Max-beans-in-cache, cachefullexception, outofmemory error
Hi,
I am trying to find the best way to find the numbers to be set in max-beans-in-cache
for entity beans. I have a stateless session bean through which I access the
entity beans. If I don't set any value for this property, in some query which
will return 2500 records, I get a cachefullexception and if I increase it and
set this property to say 5000, I get an outofmemory error.
I am not sure how to decide what value should be used.
Any help or suggestion would be greatly appreciated.
We are using WLS 7.0 on NT machines in a cluster.
Thanks,
Jaideep
If you need to perform some sort of bulk processing then perhaps you
shouldn't be using
entity beans at all.
"Jaideep" <[email protected]> wrote in message
news:[email protected]..
>
unfortunately, for a specific functionality in our application we need toget that
many records. Now I am debating about changing the finder method so thatit returns
only 500 records at one time and then I can call it multiple number oftimes.
This may not be the best thing to do and we may take some kind of aperformance
hit also but it may avoid the cachefull and outofmemory problems.
Any suggestions or comments??
Thanks,
Jaideep
Rob Woollen <[email protected]> wrote:
First off, does what does the session bean or its caller do with the
2500 or 5000 records? i.e. do you really need to select that many.
Unfortunately there is no easy answer on how to set max-beans-in-cache.
It depends a lot on your memory, application, and load.
-- Rob
Jaideep wrote:
Hi,
I am trying to find the best way to find the numbers to be set in
max-beans-in-cache
for entity beans. I have a stateless session bean through which Iaccess the
entity beans. If I don't set any value for this property, in somequery which
will return 2500 records, I get a cachefullexception and if I increaseit and
set this property to say 5000, I get an outofmemory error.
I am not sure how to decide what value should be used.
Any help or suggestion would be greatly appreciated.
We are using WLS 7.0 on NT machines in a cluster.
Thanks,
Jaideep
Dimitri
Similar Messages
-
Max-beans-in-cache, cachefullException, outOfMemoryError
Hi,
I am trying to find the best way to find the numbers to be set in max-beans-in-cache
for entity beans. I have a stateless session bean through which I access the entity
beans. If I don't set any value for this property, in some query which will return
2500 records, I get a cachefullexception and if I increase it and set this property
to say 5000, I get an outofmemory error. I am not sure how to decide what value
should be used. Any help or suggestion would be greatly appreciated. We are using
WLS 7.0 on NT machines in a cluster.
I have already tried the maxPermSize option in the jvm. The max heap size is
set to 768m.
Thanks,
JaideepPlease reply only to the newsgroup.
If you are doing a find and then invoking on the bean, splitting the transaction into
multiple transactions that return smaller sets of beans is the only thing I can think of to
get around the problem.
If you are simply doing a find, but not invoking the beans, you could set finders-load-bean
to false in the EJB deployment descriptor to avoid loading the bean when the finder is
called. The bean will then be loaded and put into the cache only when it is invoked.
However, this setting affects all finders defined on the bean and if you have transactions
that do a find and invoke, performance could be lower if set to false.
Unless relationship-caching is turned on, related beans are not loaded when a finder is
invoked.
Arunabh
"Chadha, Jaideep" wrote:
Thanks Arunabh. I tried different values and came
up with the ones that suite our needs. Also the
cache size is restricted in a transaction, we can
split the transactions into multiple transactions
especially for read-only data. Do you think that
would be a good idea? I was also thinking if it
was possible to define the attribute for the
entity beans especially in case of relationships that
they get loaded in finders when I need them but for
some methods they don't get loaded in finders. And
when a getXXX is invoked that particular bean gets
loaded at that time.
It will be helpful, if you could let me know.
Thanks,
JaideepArunabh Hazarika wrote:
Increasing the max-beans-in-cache will always mean higher memory requirements. Afraid
there is no way around it except to increase the max heap size. You could try a new
feature in WLS 7.0 - application level caches. This is specified in the application
deployment descriptor rather than at the bean deployment descriptor. With this cache,
the cache size can be specified in terms of memory-size rather than an instance-count.
You can find out how to set this from:
http://e-docs.bea.com/wls/docs70/programming/app_xml.html (search for entity-cache)
This cache would be shared across all EJBs in the application. Also, note that this will
not prevent CacheFullExceptions from occuring, but would be more useful in avoiding
OutOfMemory errors. To avoid CacheFullExceptions without indefinitely increasing the
heap size, try to limit the number of beans loaded in a single transaction.
Hope this helps
Arunabh
Jaideep wrote:
Hi,
I am trying to find the best way to find the numbers to be set in max-beans-in-cache
for entity beans. I have a stateless session bean through which I access the entity
beans. If I don't set any value for this property, in some query which will return
2500 records, I get a cachefullexception and if I increase it and set this property
to say 5000, I get an outofmemory error. I am not sure how to decide what value
should be used. Any help or suggestion would be greatly appreciated. We are using
WLS 7.0 on NT machines in a cluster.
I have already tried the maxPermSize option in the jvm. The max heap size is
set to 768m.
Thanks,
Jaideep -
Max-beans-in-cache ==== Error
Hi all,
I have a entity bean with max-beans-in-cache=5000 and one of the findByXXX fetches
more than that and the application stops with an exception. Is there anyway or
a strategy to follow when cases like this where the records of find exceeds the
max limit. This is a huge data process application and we tried to do maximum
filters to reduce the records to minimal.
Please help me with your thoughts or ideas to .. how to avoid or is there any
deployment time argument .. etc
using WL 7.0
Thanks
-arunIf you just invoke the finder, then the container should not complain
about bringing back > max-beans-in-cache elements. However if you try
to enlist > max-beans-in-cache beans in a transaction, it will throw a
CacheFull.
One way to avoid this is to limit your maxRows returned by the finder.
This can be done in the CMP descriptor.
-- Rob
Arun nair wrote:
Hi all,
I have a entity bean with max-beans-in-cache=5000 and one of the findByXXX fetches
more than that and the application stops with an exception. Is there anyway or
a strategy to follow when cases like this where the records of find exceeds the
max limit. This is a huge data process application and we tried to do maximum
filters to reduce the records to minimal.
Please help me with your thoughts or ideas to .. how to avoid or is there any
deployment time argument .. etc
using WL 7.0
Thanks
-arun -
Hi ,
I have the following parameter set in weblogic-ejb-jar.xml for a statefulsession bean.
==================================================
stateful-session-cache>
<max-beans-in-cache>2</max-beans-in-cache>
<idle-timeout-seconds>600</idle-timeout-seconds>
</stateful-session-cache>
==================================================
I then create more than 2 requests(approx 10) to the stateful session bean for which the above parameter is set.
In EJB-MONITORING-Stateful Ejbs I have the following fields set from the customize view:
Activation Count
Passivation Count
Cache Access Count
Cache Miss Count
Cached Beans Current Count
EJB Name
My understanding is that no more than 2 beans should appear in the Cached Beans Current Count.If the request is sent from more than 2 browsers invoking the stateful bean I should get Invocation Target exception.
But upon sending requests from more than 2 browsers invoking the same session bean I see that :
count of Cached Beans Current Count = number of browsers/clients from where the request is coming.
There is no exception.
Kindly clarify my understanding.
ThanksHi,
if you give some number in <max-beans-in-cache>number</max-beans-in-cache>.Then Weblogic Server going to create that many number of objects initially .
In case of statefull SessionBeans, If you give 3 ,Then Server creates 3 objects for that bean to provide service to the 3 clients at a time .
Whenever it receives the 4 requests at a time then three request's will be served at a time and 4th request will wait until the server passivate any object out of 3 in some persistant storage and create the object for 4th client.
it will not throw any exception or error if we sent more than number of requests which we were mention in max-beans-in-cache.
----Anilkumar kari -
Max Beans in Cache causes NULL Pointer Exception
Hi All,
a rather weird event (from our perspective) occurs when we do the
following:
We have an entity bean set to max beans in cache 100 (default value of
our deployment tool ), the database table related to that bean holds
lets say 300 entries.
Doing a find all and in the same session bean instanciated transaction a
processing loop over the enumeration of beans we get an NULL Pointer
exception when accesing the 101 Bean. Neverthless the Weblogic server
increases the cache size automatically but obviously not fast enough and
not on time.
has anyone experienced the same problem and has a fix for it, appart
from increasing the cache size in the deployment descriptor ?
any help welcome
MichaelHi Michael.
Can you post the stack trace of the NullPointerException? Was it in
your code or ours? Also, what version of WebLogic are you using?
-- Rob
Rob Woollen
Software Engineer
BEA WebLogic
[email protected]
Michael Rupprecht wrote:
Hi All,
a rather weird event (from our perspective) occurs when we do the
following:
We have an entity bean set to max beans in cache 100 (default value of
our deployment tool ), the database table related to that bean holds
lets say 300 entries.
Doing a find all and in the same session bean instanciated transaction a
processing loop over the enumeration of beans we get an NULL Pointer
exception when accesing the 101 Bean. Neverthless the Weblogic server
increases the cache size automatically but obviously not fast enough and
not on time.
has anyone experienced the same problem and has a fix for it, appart
from increasing the cache size in the deployment descriptor ?
any help welcome
Michael -
Hi all
If I change max-beans-in-cache property then do I need to redeploy (run ejbc on)
the stateful session beans or will the server pick it up when I just restart the
app server.
I am using Weblogic 6.1 SP2
Regards
Kamran YousafI believe I was wondering this once myself. An easy way to find out is to change
the value and then restart the server and check the EJB's configuration in your
weblogic console.
You will need to redeploy the beans though which should happen automatically if
the timestamp on your ear file or jar file changes.
"kamran" <[email protected]> wrote:
>
Hi all
If I change max-beans-in-cache property then do I need to redeploy (run
ejbc on)
the stateful session beans or will the server pick it up when I just
restart the
app server.
I am using Weblogic 6.1 SP2
Regards
Kamran Yousaf -
Max-beans-in-cache and getting mail
Hi,
Here is the situation. I am currently using the
max-beans-in-cache option in the stateful-session-cache . What I want to do is when the max bean amount has been reached and the bean is removed. At this point I would like to have an email or some kind of notification that this happened.
Does anybody have any idea how to do this?
thanks,
MarcHi,
Here is the situation. I am currently using the
max-beans-in-cache option in the stateful-session-cache . What I want to do is when the max bean amount has been reached and the bean is removed. At this point I would like to have an email or some kind of notification that this happened.
Does anybody have any idea how to do this?
thanks,
Marc -
Max-beans-in-cache, transactions and passivation
WLS 6.1 sp4
database concurrency, oracle
I compute max-beans-in-cache as:
(max # fetched in a transaction) * (number of worker threads)
therefore if I think that a table with have at most 500 rows and the
server is configured with 20 worker threads I have 500 * 20 = 10000 as
my max-beans-in-cache.
In my test the table has 7 rows. In our load test I see the Beans In
Use Count go up to 9999 instances and then start passivation.
I have two questions:
1) What does 'Beans In Use Count' really mean
2) why is weblogic using much more memory than it should to store 7 unique entities?
thanksSee my comments below.
S
Chad Urso McDaniel <[email protected]> wrote:
>
I understand this, but WebLogic should either reuse objects in the
cache/pool or not cache them at all. There are cases where the objects in the cahce are used. For e.g. with entity
beans and Read-Only concurrancy, when cache-between-tx is set. However I noticed
this behavior for other cases too and therefore the caching is not all that intellegent.
Also the beans in the pool are reused.
The current situation results in
objects being allocated, referenced by the cache so they will never be
garbage collected, but the objects are never used again once their
transaction completes. This is very, very wasteful with memory.
In some cases as mentioned above.
S
"Sri" <[email protected]> writes:
Hi,
The reason for having so many entries is due to fact that there isno way WLS
would know there are only 7 rows in the db everytime an entity beanis created/modified/accessed.
For e.g., if you run a test where you do 'findAll' the first run wouldhave 7
beans and the next most likely (There is another parameter that youcould use
to control number of beans in the cache, idle-timeout-seconds. Thoughits not
clear from the doc how the entity beans are handled wrt this parameter,it might
passivate entity beans if this timeout occurs) 14 and so on. If thisis a overhead
for your system then reduce this number.
S
container start removing beans before Chad Urso McDaniel <[email protected]>
wrote:
WLS 6.1 sp4
database concurrency, oracle
I compute max-beans-in-cache as:
(max # fetched in a transaction) * (number of worker threads)
therefore if I think that a table with have at most 500 rows and the
server is configured with 20 worker threads I have 500 * 20 = 10000as
my max-beans-in-cache.
In my test the table has 7 rows. In our load test I see the BeansIn
Use Count go up to 9999 instances and then start passivation.
I have two questions:
1) What does 'Beans In Use Count' really mean
2) why is weblogic using much more memory than it should to store7 unique
entities?
thanks -
How to determine the value of max-beans-in-cache
As we have CacheFullException problem, but I dont know what is the side effect
if I set an extremely large value for this parament. Is there any proper way
to determine the proper value?
"Jenny Wong" <[email protected]> wrote:
>
>As we have CacheFullException problem, but I dont know what is the side
>effect
>if I set an extremely large value for this parament. Is there any proper
>way
>to determine the proper value?
Hi Jenny,
The WebLogic Server allows you to configure the number of active beans (with an
identity) which are present in the EJB cache.
This cache is the in-memory space where beans exist.
When a bean is brought into the cache, ejbActivate() is called, when it is removed,
ejbPassivate() is called. It is basically
equivalent to virtual memory being kept in memory or on disk. Tuning it too high
will use up memory unnecessarily.
Activation and passivation of EJBs is analogous to virtual memory on a computer.
You want to minimize the number of times that
your beans are activated and passivated. The cache size can help minimize this
activity. To set determine if you cache size
should be bigger, take a number of execution snapshots. Look at these snapshots
of your execution and see if there is a lot of
passivation and activation going on. If so, increase the size of your cache and
see if performance improves. Otherwise, leave this
value alone.
regards,
Ashok.
-
Min size for max-beans-in-cache / stateful EJB
Hello,
Weblogic (7 and 8) seems to have a minimum size for this setting.
This minimum seems to be around 8 instances because when we set it to 3 for
instance, the cache size reported by the admin console is 8 (with 8 active
clients) and no ejb has been passivated.
Is there an explanation for this behaviour ?
LaurentI would also like to know the answer to this one.
Can the default be changed via the administration console or config.xml? If so, where? -
Bad Performance/OutOfMemory Error in CMP Entity Bean with Large DB
Hello:
I have an CMP Entity deployed on WLS 7.0
The entity bean maps to a table that has 97,480 records.
It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
I have a JSP client that invokes the findALL()
The performance is very poor ~ 150 seconds just to perform the findAll() - (Benchmark
from within the JSP code)
If more than one simultaneous call is made then I get outOfMemory Error.
WLS is started with max memory of 512MB
EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
(without max-beans-in-cache directive the performance is worse)
Is there any documentation available to help us in deploying CMP Entity Beans
with very large number of records (instances) ?
Any help is greatly appreciated.
Regards
RajanHi
You should use a Select Method, it does support cursors.
Or a Home Select Method combination.
Regards
Thomas
WLS is started with max memory of 512MB
EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>>
(without max-beans-in-cache directive the performance is worse)>
Is there any documentation available to help us in deploying CMP
Entity Beans with very large number of records (instances) ? Any help
is greatly appreciated.>
Regards>
Rajan>
>
"Rajan Jena" <[email protected]> schrieb im Newsbeitrag
news:3dadd7d1$[email protected]..
>
Hello:
I have an CMP Entity deployed on WLS 7.0
The entity bean maps to a table that has 97,480 records.
It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
I have a JSP client that invokes the findALL()
The performance is very poor ~ 150 seconds just to perform the findAll() -(Benchmark
from within the JSP code)
If more than one simultaneous call is made then I get outOfMemory Error.
WLS is started with max memory of 512MB
EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
(without max-beans-in-cache directive the performance is worse)
Is there any documentation available to help us in deploying CMP EntityBeans
with very large number of records (instances) ?
Any help is greatly appreciated.
Regards
Rajan -
Stateful beans in cache doesn't seem to work
I have a stateful bean that I have set max beans in cache to "1". When I deploy it, no errors reported or so, the Weblogic console still states "8" in the column "Cached Beans Current Count" when monitoring the bean.
When I view the descriptor in the console it looks fine. What can be wrong here?
Using Weblogic 8.1 SP4, here's the statueful descriptor:
<weblogic-enterprise-bean>
<ejb-name>MyStatefulBean</ejb-name>
<stateful-session-descriptor>
<stateful-session-cache>
<max-beans-in-cache>1</max-beans-in-cache>
</stateful-session-cache>
<allow-concurrent-calls>True</allow-concurrent-calls>
</stateful-session-descriptor>
<reference-descriptor>
</reference-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>test.mystatefulbean/MyStatefulBean/Home</jndi-name>
<local-jndi-name>test.mystatefulbean/MyStatefulBean/LocalHome</local-jndi-name>
</weblogic-enterprise-bean>I agree with you about the host not being able to install (or at least don't want to install/upgrade) their servers to php5.4... Unfortunately, I can't change that... but by shutting them off took care of all the quotes (single & double) and any other characters which would basically function like an addslashes() command. I'll paste the script below... It's still pretty much the same as when you helped me out with the script... Just minor adjustments::: If you can show me (even though I fixed the problem) how I would integrate the stripslashes() function to the comment field it would be helpful to know for future reference.
<?php // Script 1.0 - contactlist.php
if (isset($_POST['submit']) && !empty($_POST['submit'])) // Test if submit button named submit was clicked and not empty
if (!empty($_POST['first']) && !empty($_POST['last']) && !empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['comment'])) {
$comment=stripslashes($_POST[comment]);
$body = "First Name: {$_POST['first']}\nLast Name: {$_POST['last']}\nEmail Address: {$_POST['email']}\nContact Phone Number: {$_POST['phone']}\nContact Preference: {$_POST['contactvia']}\n\nBest Time To Contact: {$_POST['timepref']}\n\nComments:\n {$_POST['comment']}";
$body = wordwrap($body, 70);
mail([email protected]', 'NEW Customer Inquiry Submission',$body, "From: {$_POST['email']}");
header('Location: index.html'); //Redirect to new url if form submitted
?> -
Any suggestions on solving the "java.lang.OutOfMemory" error message?
Hi, our application is running on WLS61 and calls Tuxedo services (on Tuxedo 71)
through WTC.
What the problem we got is: about every 6-7 days, our application becomes out
of functioning and the WTC call returns the "TPEINVAL - invalid arguments given".
But in the "weblogic.log" file it logs the error message as
"####<Sep 7, 2002 1:31:19 AM CDT> <Error> <Management> <awhq6394.whq.ual.com>
<ECSserver> <Application Manager Thread> <> <> <000000> <Throwable while poller
running>
java.lang.OutOfMemoryError
<<no stack trace available>>
Please help us on the following questions:
(1) From your experiences, is it really a Memory-Leak kind of problem or WTC-related
problem, and if you have such experience, how did you solve the problem?
(2)We use the DEFAULT value of "max-beans-in-cache" (to be 1000) for stateful
and entity beans, and "max-beans-in-free-pool" (unlimited, depends on memory)
for stateless beans. Does this might cause the POSSIBLE memory-leak problem? By
the way, there are about 3000 transactions per day for our application.
Also, please give us any suggestions you think is necessary.
Thanks a lot!
Bill- Do you get the error messages in jserv.log?
- Have you read Note:119163.1 (How to set the heap size for the iAS/Jserv JVM) which ought to be avaliable on metalink? -
Ejbc outofmemory error in weblogic 8.1 sp2 when compiling cmp entity beans
I have a set of entity beans which compiled [ejbc step]fine under weblogic7.0 sp4. But when i try to to the same thing under weblogic 8.1 i get an outofmemory error. Any pointers
I am using 81 sp4
-
Reporting on Max beans ever in cache
In the Weblogic 5.1 console, for Distributed Objects/EJB/Deployed Beans, on
the properties tab there are values for max beans ever in cache and max
cache size. Is there some way to access these values through a java class
(or some other way) so that I can do a report to see what EJBs have come
close to reaching their max cache size. We have over 500 beans deployed and
need some way to pro-actively check these values. I did not see any API doc
for the console on the website.
ThanksYou can start by looking at this example:
http://dima.dhs.org/misc/WLStats.jsp
and serverinfo utility at
http://developer.bea.com/code/alpha.jsp
Chip Whiteside <[email protected]> wrote:
In the Weblogic 5.1 console, for Distributed Objects/EJB/Deployed Beans, on
the properties tab there are values for max beans ever in cache and max
cache size. Is there some way to access these values through a java class
(or some other way) so that I can do a report to see what EJBs have come
close to reaching their max cache size. We have over 500 beans deployed and
need some way to pro-actively check these values. I did not see any API doc
for the console on the website.
Thanks--
Dimitri
Maybe you are looking for
-
Non valuated sales order stock-help reqd
Dear Experts, My client is into Pipe coating business who receives the pipe from the customers, coats it as per there requirements and dispatches it thereon. There is no concept of FG here as its only the service he is doing on it and also when he re
-
Conversion of xml string to xml file
To convert xml string to xml file in java i used Document XMLDoc=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader("<root><main>Title</main></root&g t;"))); But it is showing an error as InputSource cann
-
Relation between Ap down payment invoice and Ap invoice
Hi sap members pls help in this scenario what is the query relation for ap down payment invoice and ap invoice solution given vilbe appreciated regards Jenny Edited by: Jennifer Anderson on May 3, 2010 11:02 AM
-
Email attachment with didnt used EXPORTING TO MEMORY
Hi Expert, For my development I cant using below abap code because I getting short dump when trying to execute the SAP Standard Program "RM06WCD1". When trying other program that is working fine. SUBMIT (report_name) USING SELECTION-SET p_va
-
Use of AffineTrasform in java2d
Hello, currently i have a program that draws lines from an array, that moves across the frame from right to left. it appends the data on the left of the wave. HOWEVER i want it to append the new data at the head of the wave so old data is moved to th