Out of heap caused by database access
Hi guys. I have a serious problem in my last project. I use a database to get/insert information that I need. Every now and then there is A LOT of db I/O going on (1-2mb of data being loaded/accessed).
I am using a singeton pattern (one instance) for the db connection to ensure that there is only one connection between the software and the db. The problem here is that I eventually run out of heap size. Is there any way to overcome this situation? Something like flushing db buffer (or whatever).
If I use many connections (open one, perform query/insert, close) I eventually run out of sockets because Java states that closing the db connection doesnt free the resources straigh away.
So I am stuck. If anyone can help I would really appreciate it. thx

