I made a dynamic web project in Eclipse with hibernate frameworks(servlet).
The first run is ok.
But run it for more times, i get this Exception
Tomcat v7.0 Server at localhost, jdk1.7.0_17.
On Win2007 32 bits with 4GB of RAM
I made a dynamic web project in Eclipse with hibernate frameworks(servlet).
The first run is ok.
But run it for more times, i get this Exception
Tomcat v7.0 Server at localhost, jdk1.7.0_17.
On Win2007 32 bits with 4GB of RAM
This could be happening if you have a low memory allocated for the VM. Increase the memory(PermGen) available for the VM.
If you still have an issue after increasing the memory, then attach a profiler and inspect to see if you have any memory leaks.
I can think of two problems, depending on what you mean with "run it for more times":
SessionFactory
/EntityManagerFactory
. As a rule of thumb make sure you only create one SessionFactory
/EntityManagerFactory
over all the lifetime of your aplpication. Each invocation should only create a Session
/EntityManager
from the existing factory.