12 Replies Latest reply on Apr 17, 2013 3:30 PM by scolly

    Script slows down


      Script slows down


      FileMaker Pro


      11 advanced

      Operating system version


      Description of the issue

      I have about 1200 records to process where I do calculations based on data in other tables. When I first start the script it takes about 5 seconds to process each record after about 10 records it slows down to about 30 seconds then gets slower. All I have to do is close down Filemaker, start it up again and the same pattern repeats. I have tried a flush cache. I thought it might be the CPU over heating but stopping the script waiting 5 mins and starting makes no difference. Just closing filemaker and restarting is the only way to get it back to full speed.

        • 1. Re: Script slows down

               Hi Ian,

               But did you tried to increase the cache amount located in FileMaker Pro Preferences, Memory tab ?

               I am no shure it could help, but i hope...

               Bye, Fred

          • 2. Re: Script slows down

                 Thanks for your comment. Yes I increase the default cache from 64 to 128 Mb and it has made no difference. The Activity monitor also shows plenty of memory available. About 1 G



            • 3. Re: Script slows down

                   Does your script update data in indexed fields?

                   I'm speculating that your script may be dealing with indexes that grow rapidly in size and complexity when your script modifies data in a way that adds new entries into the indexes as a side effect of what you are doing with your script...

              • 4. Re: Script slows down

                     Yes I am increasing the indexes. The strange thing is that when I stop the script and address filemaker directly it is painfully slow. If I do a find, it takes 2-3 second to show the cursor in a field. If I manually go through records it again is slow.

                     There is nothing unusual in my scripts that I have not used many times before.

                • 5. Re: Script slows down

                       What  about the layout were the script is executed ? Is there unstored calculation or summary fields on it ?

                  • 6. Re: Script slows down

                         And are you using Freeze WIndow in your script?

                    • 7. Re: Script slows down

                           Thanks for the comment

                           I added freeze window and it makes no difference.

                           It takes about 5 seconds for the first record and then very quickly takes 30seconds then more untill I shut down filemaker and start it up again. I am running out of ideas. I did 50 records then left it over night and it had only done 180 records 7 hours later. Very painful. It would take about 4 days to do all my records as opposed to 5 hours if it did not slow down.

                           It must be something to do with the memory management, garbage collection or something. BUt I can't see any script steps that would clean up the memory apart from the cache one.

                      • 8. Re: Script slows down

                             These calculations you made, can they establish themself new relationships ?

                             If true, must they next bring back summary results from the related table to write in current table ?

                             If true is the relationships graph very complex with a lot of occurrence of the same table ?

                             If not, and assuming it is not a specific bug on FMP or on your computer, to see how configure better the file, i think we will need at least the critical script and the relationship schema on PDF.

                        • 9. Re: Script slows down

                               Ianms issues appear to me to be too extreme to be caused by an excess of calc or summary fields. I can't offer a solution. He seems to have done the necessary steps. I would, however, do a recover on the file(s) to get any idea of possible file damage.


                          • 10. Re: Script slows down

                                 Thanks for your comments. This is really proving very curly. I am going to reinstall Filemaker on the off chance it is corrupted.

                                 I have put a freeze window in, removed any relationships not needed for this script, I have even removed the steps that create new records and some which store some global variables, so the script does not actually achieve anything but still slows down!!!

                                 It almost makes me believe in programme goblins,

                                 I have disabled every step I can to see where the prroblem starts from but it keeps slowing down.

                                 I have recovered the file and it shows no errors.

                            • 11. Re: Script slows down

                                   But did you test the recovered file to see if it still has the same behavior. Even when Recover reports no errors, the recovered file is different from the original and that may result in a change in behavior.

                              • 12. Re: Script slows down

                                     Thanks for all your help everyone who has posted a comment. Our IT department installed Filemaker 12 and it works perfectly. I have claculated all my records in about 2 hours as each record now takes about 2 seconds and does not change as the script progresses.

                                     Frustrating in away. I do not have the probem any more but do not know the reason why. Does that mean that the memory management on FP11 has a fault? Why has it only shown up now, I have run similar scripts to these.

                                     I will try the recovered file as PhilModJunk has suggested. If any one has any other insight I would still be interested to try and find out why?