I have a function which loops over a query and updates a database row for each item. After about 7000 iterations it\'s throwing an out of memory error - Java heap space. Is ther
The following can be done:
Change your to use the appropriate cf_sql type. Are code and id really strings?
Don't give your a name. You are not keeping the result anyway. var loc doesn't help either
Bump up you memory to the JVM Addtional approach Use Java 7 and G1GC
Every 100 to 1000 iterations do a forced Garbage Collect
Update your data in bulk. XML based table variables can do this.
Make your function silent
Consider ORM on this