Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDORevisionImpl instance count
[CDO] CDORevisionImpl instance count [message #1016658] Thu, 07 March 2013 09:40 Go to next message
Per Sterner is currently offline Per SternerFriend
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 #1016698 is a reply to message #1016658] Thu, 07 March 2013 11:35 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6681
Registered: July 2009
Senior Member
Am 07.03.2013 10:40, schrieb Per Sterner:
> 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.
I can't see a question mark here. Unless you ask a specific question I can only recommend to increase the heap size if
it's not sufficient for your use case.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] CDORevisionImpl instance count [message #1016712 is a reply to message #1016698] Thu, 07 March 2013 12:52 Go to previous message
Per Sterner is currently offline Per SternerFriend
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

Previous Topic:[CDO] Error when editing a resource (in a repository with security)
Next Topic:[CDO] Error creating repository in h2 DB
Goto Forum:
  


Current Time: Tue Mar 19 07:32:30 GMT 2024

Powered by FUDForum. Page generated in 0.01547 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top