We are experiencing a problem running MySql 5 whereby under heavy load(with 2 connection and getting raw data from two or three table by a common java task that is running as infinite loop ), memory usage just continues to grow until it exceeds 2Gb and starts the machine swapping.

I also closing all resultset, statement and preparestatemen t in finally block and after that making it as null. But i could not find any solution.
...