Coldfusion OutOfMemoryError (CF9/Wheels)

后端 未结 2 1686
南方客
南方客 2021-01-24 07:29

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

2条回答
  •  悲哀的现实
    2021-01-24 08:28

    The following can be done:

    1. Change your to use the appropriate cf_sql type. Are code and id really strings?

    2. Don't give your a name. You are not keeping the result anyway. var loc doesn't help either

    3. Bump up you memory to the JVM Addtional approach Use Java 7 and G1GC

    4. Every 100 to 1000 iterations do a forced Garbage Collect

    5. Update your data in bulk. XML based table variables can do this.

    6. Make your function silent

    7. Consider ORM on this

提交回复
热议问题