Export data more than 2 lakh lines to a speradsheet using Spredsheet gem

Hi all,

i am exporting data from database to spreadsheet since table content
huge i am writing into n+1 th sheets if rowcount > 65000 but

i am receiving failed to allocate memory error while exporting more than
2 lakh line.is there any limitation in spreadsheet gem or is there any
way to handle this issue.