Performance Issue [message #530956] |
Mon, 03 May 2010 07:55 |
Sarkan Messages: 10 Registered: May 2010 |
Junior Member |
|
|
Dear All,
I was testing my project on following environment:
server : OC4J
JVM-Heap: 2056
Technology used: EJB3, Eclipselink, icefaces
Profiling: JProfiler
os: Linux
The issue we are facing during our load testing is a very high number of QueryKeyExpression objects are created during the load of 50 users which is consuming almost 40-50% of memory allocated.
I just want to know is there any configuration using which we can control number of objects created by eclipselink classes.
Urgent reply would be highly appreciated.
Thanks,
[Updated on: Mon, 03 May 2010 11:28] Report message to a moderator
|
|
|
Re: Performance Issue [message #531070 is a reply to message #530956] |
Mon, 03 May 2010 15:30 |
|
That is odd, what is the query you are executing?
Have you already logged in, before the query? If not, it could be the startup initialization of all of your named queries.
How many expressions are being created, and what is the size of your project?
James : Wiki : Book : Blog : Twitter
|
|
|
|
Re: Performance Issue [message #531178 is a reply to message #531079] |
Tue, 04 May 2010 06:17 |
No real name Messages: 2 Registered: May 2010 |
Junior Member |
|
|
Hi,
I don't have a solution, but apparently the same 'problem'. For us, the heap is running low, too, but we have over 3 million of these objects (exact counter for both servers after running a load test with over 50 users here: 3,252,219 and 3,673,138).
Our environment (quite the same) - clustered x2:
server : OC4J 10g
JVM-Heap: 1024
Technology used: EJB3, EclipseLink, icefaces
Profiling/Monitoring: dynaTrace
os: suse enterprise Linux
Nearly 300 MB reports dynaTrace as being used by this single object which is from my perspective a little bit too much.
I'm not saying basically that there is a bug or something like that, it could be that the application code is using eclipselink in a not so optimal way which results in this.
The size of the project here is around 1000 tables with a not so easy to count named queries (I'm guessing 500).
Any advice on what I can analyze would be really helpful!
Thanks
[Updated on: Tue, 04 May 2010 06:22] Report message to a moderator
|
|
|
Re: Performance Issue [message #531956 is a reply to message #531079] |
Thu, 06 May 2010 15:16 |
|
A million for 1000 queries definitely seems like something is wrong. Unless you have some insanely big queries, I would expect at most 10 per query, so around 10,000. Expressions are also used by mappings so for 500 classes you could have another few thousand.
Can you try using a memory profiler such as JProfiler to determine what is holding onto these queries?
Also ensure the gc has run, if you have a lot of memory the gc may have just not cleaned them up yet.
Is it just one specific query that causes the issue, or does this occur at startup after you first access to JPA, or does it gradually get worse as the application is used?
Are you executing a lot of dynamic queries?
Are you creating multiple persistence unit factories?
James : Wiki : Book : Blog : Twitter
|
|
|
|
Re: Performance Issue [message #533352 is a reply to message #530956] |
Thu, 13 May 2010 13:45 |
|
I assume you are using some sort of memory profiler to determine the number of QueryKeyExpression instances.
If you cannot determine what is holding onto these instances please include the number of instances of other EclipseLink classes, or make the full dump available (attach to a bug).
Key classes are:
RelationExpression
CompoundExpression
ReadAllQuery
ReportQuery
ReportObjectQuery
ServerSession
ClientSession
UnitOfWorkImpl
EntityManagerFactoryImpl
RelationalDescriptor
Could you also try setting the following in a SessionCustomizer,
session.getProject().setJPQLParseCacheMaxSize(0);
and,
for (ClassDescriptor descriptor : session.getDescriptors().values()) {
descriptor.getQueryManager().setExpressionQueryCacheMaxSize( 0);
}
Does this have any affect?
James : Wiki : Book : Blog : Twitter
|
|
|
|
Re: Performance Issue [message #534940 is a reply to message #530956] |
Thu, 20 May 2010 17:57 |
|
What do you mean by Batch.Join? Are you using batch reading, the BATCH query hint? Please include the code for your query.
Assuming you are using batch reading, and using LAZY, and caching, and have a very large cache size (what is your cache size?). The issue code be that the BatchValueHolder will hold the batch query which is defined from copying the original query and anding it with the mapping's query. This is a copy of the Expressions, but will only be one per query. However if you did a lot of these queries, you could get a lot of these expressions cached. Say if each query has 10 expressions, and you executed 100,000 independent queries and cached these 100,000 objects, and never instantiated their LAZY relationships, then you could get 1,000,000 expressions.
Please include the instance counts for the classes I listed in my previous reply, as well as your entities.
If you only use batch reading when you intend to instantiate the relationships, this may avoid the issue.
You also seem to be holding onto a lot of your objects, maybe decrease your cache size, or investigate how many of your own objects are in memory and what is holding onto them.
Also try the EclipseLink 2.1 release. Batch reading has been improved to prepare the batch queries, so this should reduce the number of expressions to 1 per named query, instead of 1 per executed query.
James : Wiki : Book : Blog : Twitter
|
|
|
Powered by
FUDForum. Page generated in 0.02675 seconds