I have a webservice which connects to the db and fetches the data for the given input.
The resultset is traversed and converted to a list of objects, this list is sent back to the requestor.

Now for a particular query which returns a large chunk of data say 73000 records, I get a "out of memory" error.
Assuming that each records will be of 1kb , our result set will be of 71mb approx. Now when we traverse the RS and make a list out of it, I assume the total size of the class object to reach 3 times the size of the RS i.e 213mb.

I have 3 solutions to solve this problem, but none of these is the best solution I can think of.
1. Paginating the data, not possible as this is a web service and we cant have a delimiter as an input to the service.
2. Increasing the JVM size, can be increased to max 1GB, but this will fail in the scenario where there are multiple hits. (Short term solution)
3. Release the RS objects once they are added to the list, this would bring down the size of the class object to 142 mb max.

Is there any other solution to this problem?
Is there a upper limit to the size of data that can be sent through an Webservice?