Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » eclipselink flush mode out of memory(fush-mode value="COMMIT" out of memory exception)
eclipselink flush mode out of memory [message #1007742] Thu, 07 February 2013 06:31 Go to next message
Andrew Petrov is currently offline Andrew Petrov
Messages: 2
Registered: February 2013
Junior Member
In my project I use eclipselink JPA
In properties xml to encrease perfomance a make
eclipselink.persistence-context.flush-mode = COMMIT
As I see all inserts are made when transaction commit.
So when I give more test data I'l get out of memory exception.

<properties>
<property name="eclipselink.jdbc.batch-writing" value="Oracle-JDBC" />
<property name="eclipselink.jdbc.cache-statements" value="true" />
<property name="eclipselink.jdbc.native-sql" value="true" />
<property name="eclipselink.cache.size.default" value="5000" />
<property name="eclipselink.persistence-context.flush-mode" value="COMMIT" />
</properties>

Is there any option to say to JTA to flush when cache for insert too big. Or maybe I can make smth like : flush each 1000 rows. But will be cache limiting in Mb for example.
Re: eclipselink flush mode out of memory [message #1007760 is a reply to message #1007742] Thu, 07 February 2013 07:35 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1017
Registered: July 2009
Senior Member
You cam control when statements are flushed using EntityManager.flush(), and clear the cache using em.clear(). Using the two at appropriate intervals to allow statements to be batched will help performance and reduce memory use, but you will need to tune it appropriately.
Re: eclipselink flush mode out of memory [message #1007766 is a reply to message #1007760] Thu, 07 February 2013 07:55 Go to previous messageGo to next message
Andrew Petrov is currently offline Andrew Petrov
Messages: 2
Registered: February 2013
Junior Member
Yes this ofcourse come to my mind. First I just give more memory to java machine, but that was not enough and I understand that I should tune it manually but hope that some configuration properties exists.
Because this property flush-mode seems like an legal memory leak. You just turn it on and there is a huge possibility to get out of memory.

Thanks for you answer, maybe there are any property that we don't know. Smth like to say : make commit every 100 sentencies
Re: eclipselink flush mode out of memory [message #1007772 is a reply to message #1007766] Thu, 07 February 2013 08:20 Go to previous message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1017
Registered: July 2009
Senior Member
Flush mode will not drastically change the memory footprint. Statements are only generated on the flush and should be quickly garbage collected if needed, while the entity cache will still fill up unless it is cleared.
Previous Topic:JPA CriteriaQuery MD5
Next Topic:JPA Timeouts
Goto Forum:
  


Current Time: Sat Aug 23 13:34:56 EDT 2014

Powered by FUDForum. Page generated in 0.01917 seconds