I have already set it to be 4GB.
Needs["JLink`"]
ReinstallJava[JVMArguments -> "-Xmx4096m"]
However, when exporting a dataset to Excel sheet, I still get the following:

Very frsutrating after a long wait and still getting this error. My laptop does have 32G of RAM. But is there a way to figure out how much to set in advance (instead of setting to the limit)?
Thanks.
ans. – Kuba Nov 03 '17 at 06:43ByteCount[Prepend[ans, Range[85]]]return? – J. M.'s missing motivation Nov 03 '17 at 06:55ReinstallJava[JVMArguments -> "-Xmx8192m"])? – J. M.'s missing motivation Nov 03 '17 at 14:50