Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM when using batchUpdate #63

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 3 comments
Open

OOM when using batchUpdate #63

GoogleCodeExporter opened this issue Mar 25, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. using batchUpdate with thousands of insert records
2.
3.

What is the expected output? What do you see instead?
should not give OOM

What version of the product are you using? On what operating system?
1.2

Please provide any additional information below.

Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2882)
        at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
        at java.lang.StringBuffer.append(StringBuffer.java:224)
        at net.sf.log4jdbc.Slf4jSpyLogDelegator.buildSqlTimingDump(Slf4jSpyLogDelegator.java:415)
        at net.sf.log4jdbc.Slf4jSpyLogDelegator.sqlTimingOccured(Slf4jSpyLogDelegator.java:370)
        at net.sf.log4jdbc.StatementSpy._reportSqlTiming(StatementSpy.java:333)
        at net.sf.log4jdbc.StatementSpy.reportSqlTiming(StatementSpy.java:310)
        at net.sf.log4jdbc.StatementSpy.executeBatch(StatementSpy.java:527)
        at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
        at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
        at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:881)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:619)
        at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:866)
        at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.doExecuteBatchUpdate(SimpleJdbcTemplate.java:266)
        at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.batchUpdate(SimpleJdbcTemplate.java:243)

Original issue reported on code.google.com by [email protected] on 19 Jun 2013 at 6:56

@GoogleCodeExporter
Copy link
Author

when use MyBatis,and  execute batchSave also OOM

example:

    <insert id="batchSave">
        insert into table_name(id,column_a,column_b,date_time)
        <foreach collection="list" item="item" index="index" separator="UNION ALL">
            select sys_guid(),
            #{item.columnA,jdbcType=VARCHAR},
            #{item.columnB,jdbcType=VARCHAR},
            sysdate
            from dual
        </foreach>
    </insert>


Original comment by [email protected] on 17 Apr 2014 at 2:25

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

What is your batch size?

Original comment by [email protected] on 17 Apr 2014 at 10:39

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Is there a way to resolve this

Original comment by [email protected] on 25 Nov 2014 at 7:30

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant