I am trying to create 10000 random instances of an entity to do some volume testing.
My code is very simple. I have a stateless session bean with a method to create an instance from a value object, and a JUnit test which loops round 10000 times using that session bean to create one.
I get to about 25000 and then things start slowing down and eventually I get OutOfMemory.
I've attached the two source files.
Shouldn't I just be able to create as many as I want? What are the factors here?