First, configure an Infinispan cache for Modeshape with a BDBJE cache loader. The attached standalone-modeshape.xml has a configuration for that, with the BDB and Lucene index files being stored in /tmp/modeshape. Eviction is enabled and max-entries is 500.
Configure the required BDBJE modules in modules/org/infinispan/main/:
infinispan-cachestore-bdbje-5.1.2.FINAL.jar
je-4.0.92.jar
Add these to modules/org/infinispan/main/module.xml
Set the JVM max memory to 1GB. Start JBoss. Access the repository using the rest service to initialize the repository. (If you don't do this, deploying the EJB below sometimes fails - a separate issue.)
Deploy the attached create-nodes-test.jar. This contains an asynchronous EJB with bean managed transactions. It attempts to create a million nodes in batches of 1000. The transaction is committed, session logged out, and a new session created in each batch. (Without the session logout, the OOM occurs very quickly. With it, it is much slower.)
Let the program run and it will eventually crash, sometimes in different ways depending upon platform.
The jconsole memory graphs are attached for a run on a 32 bit RHEL 5 machine.
The Eclipse project for the create-nodes-test EJB jar is attached in create-nodes-test.zip