Reputation: 19
I have a huge amount of data (~4 GB) returned from db as an iterable list. I want to return this data from my rest api as a JSON. I can only use 512 mb of Java heap for this task. What approach I can take for this? I have tried Java stream but as of now, I always hit heap out of space error. Any example will be of great help. ☺️
Upvotes: 0
Views: 4827
Reputation: 138
I propose this solution :
Upvotes: 2