When an export is triggered from Ant, even the resultSetTableFactory is set to ForwardOnlyResultSetTableFactory the process ignores this setting and uses CachedResultSetTableFactory anyway.
<property name="http://www.dbunit.org/properties/resultSetTableFactory" value="org.dbunit.database.ForwardOnlyResultSetTableFactory"></property>
This makes it impossible to export big tables with dbunit launched from Ant.
However the code sample given in the FAQ works fine:
http://dbunit.sourceforge.net/faq.html#streaming
... so launching the export using the Java API the recommended way works, indeed uses streaming mode.
Likely the problem is caused by this code:
getDatabaseDataSet() is called with forwardonly=false here:
https://sourceforge.net/p/dbunit/code.git/ci/master/tree/dbunit/src/main/java/org/dbunit/ant/Export.java#l244
Attached is a git patch.
Thanks for the patch zdenek-z.
Committed for 2.5.4.