I have been designing a Java server, connected via PHP, that accepts a series of protein chains and performs computations on each of them. The computations are handled by external Perl scripts which return data to Java which is then inserted into a MySQL database.
Java successfully executes the Perl scripts and returns the data, the problem lies in MySQL inserting the data. Java seems to be throwing an OutofMemory exception (running out of heap space). After Googling around most solutions seem to involve "Increase the heap size", the problem with this is for 10 proteins chains increasing the heap size to 500MB seems to solve the problem but if 20 chains are entered again the heap size will have to increase and 1000 chains (what the system should be able to handle) increasing the heap size is not an option.
My question is this.
- What is a MySQL INSERT doing which is causing the heap to fill, and why is the JVM not cleaning up the excess data? The MySQL query is not a prepared statement and is just a simple INSERT and executeUpdate. We are using the driver mysql-connector-java-5.1.13-bin.