Hello,
I am using JSF and JPA for my web based project ( No EJB and No Spring frame work) . I am facing the problems related to memory usage due to the persistence.
Project Requirement :
I need to display the web pages with data from the database tables. Where I have some operations like adding new record and editing the record. I have more than 10 pages like this.
Problem:
Since I am using the JPA to avoid the tight interaction with the DB, the data are persisted in the memory, Which leads to the Java Heap Memory problem, when I am going to one page to another. Because the page has to show all records from the database table (Lazy loading is used for the LOB). So I, cleared and closed the Entity Manager after the data fetched from DB. But it doesn't make any difference. The JVM memory heap also -Xmx4096m (i have added upto 40p6 MB to solve the problem). Still the problem persists.
Configuration:
JPA : Application Managed Entity Manager and Resource Local Transaction.
The development Server : Tomcat 5.5
JEE : Java 5 with Annotation
Please correct me, if I am wrong and help me to fix this problem.
|