I have a simple EAR application running on Glassfish using JPA. It reads the records from my Oracle DB table and processes them. After processing, they are marked as such in the database, and then I call clear () in the entity manager so that the processed objects can be disconnected and GC'ed. However, although, since we added that explicit () use of the heap has decreased, the total heap is still increasing and eventually ends up in the maximum heap. There are no other objects that can cause a leak, and I have no idea what else I can do. We also disabled JPA cache.
<property name="eclipselink.cache.shared.default" value="false"/>
Does anyone know what else I can do to make sure JPA objects are not stored? Maybe this is related to transactions? We use a new transaction every time we update the last batch of processed records.
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
Any suggestions are welcome. I know that I can profile the application, but it’s quite difficult to see this problem, and even if I do, I expect that there will be some JPA objects that are not collected, and I’m not sure that I’m missing one in terms of cleaning objects since they are no longer required.
James
James source
share