[CDO] CDORevisionImpl instance count [message #1016658] |
Thu, 07 March 2013 09:40 |
Per Sterner Messages: 91 Registered: October 2011 |
Member |
|
|
Hello,
I did a little test for our environment and got an out of memory exception. Then I tried to reproduce the situation with a CDO testcase.
(We are using the current trunk from CDO)
As test scenario I used "Combined, H2-auditing, JVM, native" and I only executed this test. I modified the runtime to only use 200MB.
After ~ 5 minutes out of memory exception occurs. With JVM I see that the EObjects from the model are not filling up the memory, the CDORevisionImpl's and some other instances are growing.
Regards,
Per Sterner
*******************************************************
MyCommitTest.testCommits [Combined, H2, JVM, Native]
*******************************************************
------------------------ START ------------------------
Processed: 0
...
Processed: 465
Processed: 470
Processed: 475
Processed: 480
[ERROR] org.h2.jdbc.JdbcSQLException: Nicht genug Hauptspeicher.
Out of memory.; SQL statement:
...
private CDOSession session;
private CDOTransaction transaction;
private CDOResource resource;
@Override
protected void doSetUp() throws Exception
{
super.doSetUp();
session = openSession();
transaction = session.openTransaction();
resource = transaction.createResource(getResourcePath("/my/resource"));
transaction.commit();
}
public void testCommits() throws Exception
{
CDOCommitInfoManager c = session.getCommitInfoManager();
int counter = 10000;
for (int i = 0; i < counter; i++)
{
if (i % 5 == 0)
{
System.out.println("Processed: " + i);
}
createModel(1, 1, 1000);
}
System.out.println("Ready.");
}
private void createModel(int companies, int categories, int products) throws Exception
{
for (int i = 0; i < companies; i++)
{
Company company = null;
if (resource.getContents().isEmpty())
{
company = getModel1Factory().createCompany();
company.setName("Eclipse Foundation " + i);
company.setStreet("Milinkovic Street");
company.setCity("Ottawa");
resource.getContents().add(company);
}
else
{
company = (Company)resource.getContents().get(0);
}
for (int j = 0; j < categories; j++)
{
Category category = getModel1Factory().createCategory();
category.setName("Special Category " + i + "/" + j);
company.getCategories().add(category);
for (int k = 0; k < products; k++)
{
Product1 product = getModel1Factory().createProduct1();
product.setName("Awesome Product " + i + "/" + j + "/" + k);
product
.setDescription("This descriptive text is the same for all products in all categories of all companies.");
product.setVat(VAT.VAT15);
category.getProducts().add(product);
if (k % 200 == 0)
{
commit();
}
}
commit();
}
}
}
private CDOCommitInfo commit() throws Exception
{
return transaction.commit();
}
-
Attachment: jvm.png
(Size: 71.40KB, Downloaded 155 times)
[Updated on: Thu, 07 March 2013 10:03] Report message to a moderator
|
|
|
|
Re: [CDO] CDORevisionImpl instance count [message #1016712 is a reply to message #1016698] |
Thu, 07 March 2013 12:52 |
Per Sterner Messages: 91 Registered: October 2011 |
Member |
|
|
The objects appended are only commited and not directly referenced from the testcase (only the resource, one company and the list are referenced).
1. H2 takes 64MB of ram and the testcase starts after the first commit with 100mb or so. CDO caches and occupies as much as possible.
2. That's why I set the ram to a limited size to check if there are some fixed references
And the item count from some objects (CDORevsionImpl and some other, the appended picture shows the item count) are continuously growing. After some time the item count reaches a value of 400000 and the memory exception occurs. I would think these objects could be garbage collected at some point? But the problem is that these items are still needed(?) or referenced?
Must I tweak the prefetchig options?
Regards,
Per Sterner
P.S.: It also happens if I have a limit of 1GB
[Updated on: Thu, 07 March 2013 13:11] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01547 seconds