camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Payne <>
Subject Question: camel-sql out of memory error
Date Fri, 08 Aug 2014 20:34:12 GMT
I am getting an  java.lang.OutOfMemoryError: Java heap space when using
camel sql component with a query that returns a large number of rows.

Using a small value for maxMessagesPerPoll=10 does not help[1].

When reading the source[2], I see:
255   protected List<Map<String, Object>> queryForList(ResultSet rs) throws
SQLException {
256         ColumnMapRowMapper rowMapper = new ColumnMapRowMapper();
257         RowMapperResultSetExtractor<Map<String, Object>> mapper = new
RowMapperResultSetExtractor<Map<String, Object>>(rowMapper);
258         List<Map<String, Object>> data = mapper.extractData(rs);
259         return data;
260     }

It seems that all of the result set, rs, is going to be read regardless of
how large it is.   When stepping through via eclipse's debugger this is
what I see happening.

It's unclear how to ask camel sql component to only take X rows at a time.
  Is there a way to do this please?

Thanks! --Matt Payne


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message