Beginner |
 |
Joined: Thu Aug 19, 2004 5:36 am Posts: 30 Location: Italy
|
Hibernate version: 2.1.7
Name and version of the database you are using: PostgreSQL 8.0
I'm writing a web application using Tomcat 5 and I've just started to add the persistence layer.
In this application I need several SessionFactory(es) that are initialized in a class implementing the ServletContextListener interface.
After a good number of stop/start of the application (without calling any action!: only starting and stopping) I've got an OutOfMemoryException.
Checking the initialization procedure I realized that SessionFactory was never closed and so I've added a .close() but the problem persist:
at every restart of web application some megabytes of memory are allocated and never released (sometimes 1 or 2; sometimes 4 or 5mb).
In this test I have 2 SessionFactory: one with 5 trivial mappings and another with 2 mappings (a parent/child).
At the end of these tests I'm quite sure that the problem is in sessionfactory creation (removing this operation the memory usage is normal).
I'm also sure that I'm making some huge mistake, but I cannot figure out where.
Any suggestion?
|
|