Hi,
I’m facing the problem with external sort component. “I get java.lang.OutOfMemoryError: Java heap space” when I try to sort a data from table containig large amout of rows. I use JDBC driver for MSSQL 2000. Any help would be appreciated.
Than you Jan
Hi,
make sure you have correct parameters for both ExtSorter (sorterInitialCapacity) and JVM (-Xmx parameter - maximum heap size).
As for ExtSorter, it allocates up to 8 buffers each slightly bigger than the previous one. The total multiplication factor is about 60 - i.e. total size of all allocated buffers is 60 * initial capacity.
However, you problem can also be caused by JDBC driver - some of them try to preload all records for returned result set into memory - if the result of SQL query run against MSSQL is really large, it can be this problem.
Check the JDBC driver documentation. For example MySQL JDBC driver does this unless fetch size is specified.
David