We tried increasing the heap and it did work, but we can have many such reports running parallely in the server, and if each report conusmes more than normal heap space the entire server response would slow down, hence looking for a better solution.
Reg: release the memory, tried calling System.gc() after reaching a certain number, but this is taking time to finish off the complete process.