1 2 3 Previous Next 30 Replies Latest reply on May 5, 2015 1:06 PM by Devon Braun

    What would cause FMP to sleep so soundly?

    Devon Braun

      Here's the challenge I'm facing: I've got an FMP db running script on a 30-second interval.  It works at first, but after a time (about 15 min) it becomes unresponsive.

      The obvious causes do not seem to apply:

      - Disconnect when idle is not check marked for the active privilege set.

      - The computer hosting the db is set to never sleep (MacOS Yosemite > System Preferences > Energy Saver)

       

      As an alternative to the Install OnTimer Script feature I tried calling the script from a web browser using the fmp:// protocol using a JavaScript setInterval command in a browser window, figuring that would force FMP to wake up.  Same results: it works for a time but becomes responsive.

       

      After running a few tests turned up some interesting details:

      The JavaScript interval does remain active (I have it sending out a ping each time it attempt to roust FMP from its slumber), but it does slow down considerably.  So something's slowing down or idling on the computer even if it's not officially "asleep".  Any mouse move will 'wake up' FMP and it will suddenly respond to the prior calls to action as if they were buffered somewhere.

       

      Any ideas?

        • 1. Re: What would cause FMP to sleep so soundly?
          Markus Schneider

          Not sure if I got this

          - DB is hosted by FM Server (or a client)

          - a client machine with FMPro is running the script

           

          - by On Timer script step?

          - the client doesn't go to sleep?

          - there are no other app's involved (indexing, TimeMachine, whatever)?

           

          YOu might check the 'AppNap' settings (cmd-i on the FileMaker application)

          • 2. Re: What would cause FMP to sleep so soundly?
            Devon Braun

            Hi Markus

             

            DB is not hosted.  I used the word hosting incorrectly to refer to the computer that's merely running the active DB.  So there's just one computer involved, it's set to not sleep.  TimeMachine and indexing are not running.

             

            Originally I was using an On Timer script step, but when that didn't work, I switched to the method using JavaScript's setInterva() to trigger the fmp:// protocol to see if that might be able to wake up FMP on an interval.  At this point the only other app involved is a web browser (I'm testing both Chrome & Safari).  The browser, I'm able to confirm continues to call FMP on an interval without fail (Safari slows down but never stops).  FMP at first is responsive to the browser calls but eventually stops responding.

             

            Thanks for the AppNap tip.  Sounds promising.  Testing now...

            • 3. Re: What would cause FMP to sleep so soundly?
              user16545

              Is your On Timer Script Byting it's own tail?
              What happens if you set longer intervals for your On Timer Script?

              • 4. Re: What would cause FMP to sleep so soundly?
                Devon Braun

                It's a good question. The scripting does take that into account.  When the main routine runs it sets a 'busy' flag.  Any subsequent attempts to run the same script are turned away until the process completes and the flag resets to 'idle'.

                • 5. Re: What would cause FMP to sleep so soundly?

                  FileMaker doesn't sleep however it can become sluggish in low memory situtations such as opening 30 windows or if your script creates a large memory use.

                   

                  Consider this

                   

                  Loop

                    do a lot of memory intensive stuff

                    pause 30 seconds

                  end loop

                   

                  This is a perpetual loop but it is possible that your memory is being consumed as variables, large amounts of records, sorts, etc. are overloading your memory and may be written to virtual memory which is being overloaded. (All theorey....)

                   

                  The script might be modified to

                   

                  Loop

                    Flush Cache or close windows  ( have a script that closes all windows but 1)

                    do a lot of memory intensive stuff

                    pause 30 seconds

                  end loop

                   

                  You could insert a perform script that puts the names of open files, tables, windows, layout names, found counts, etc into a variable and display that variable during the pause....

                   

                  Loop

                    do a lot of memory intensive stuff

                    create informative $$_variable

                    go to layout showing $$_variable

                    pause 30 seconds

                  end loop

                  • 6. Re: What would cause FMP to sleep so soundly?
                    Devon Braun

                    Markus, I really expected that AppNap setting to do the trick, but so far no luck.  It's looking like something - TBD - about the way MacOS handles going into Display or Hard Drive Sleep (under System Preferences > Energy Saver)

                    The computer doesn't sleep: Safari, for example, continues to run interval functions, albeit at a pace far slower than when it's fully awake.  But FMP doesn't respond at all until the computer is fully active again.

                    • 7. Re: What would cause FMP to sleep so soundly?
                      siplus

                      We are very happy with this product: http://www.oliver-matuschin.de/en/projects/detail/task-till-dawn

                       

                      It allows us to periodically open a DB which on FirstWindowOpen calls a script in another database then closes, a script that for various reasons does not play well if called by a schedule on FMS.

                       

                      Give it a try.

                      • 8. Re: What would cause FMP to sleep so soundly?
                        Devon Braun

                        jackrodgers -- I ran a few tests based on your idea.  I think in this case it's not a low memory situation as such.  It's a small DB, running alone, one window open, doing nothing except running either the On Timer script or simply waiting patiently for marching orders.

                         

                        Based on your suggestion, I ran the kind of "Wakeup every 30 seconds" script loop you suggested, but no luck.

                         

                        It's looking like the cause of the problem has something to do with the MacOS 'Display Sleep', not to be confused with 'Computer Sleep', which is set to 'never' (both under MacOS > System Preferences > Energy Saver).  The moment the computer goes into 'Display Sleep', the FMP On Timer script stops, as does the Loop & Pause routine you suggested.  (Outside of FMP, a browser-based JavaScript setInterval running every 5 seconds, slows to once every 100 seconds, but unlike FMP it does keep running)

                         

                        So far the solution has been to set 'Display Sleep' to 'never' and dim the screen manually.  The benefit of the Display Sleep, aside from automatically protecting the screen, was security in that it required a password to get the monitor back on.

                        • 9. Re: What would cause FMP to sleep so soundly?
                          siplus

                          Also be warned that built-in screen savers like "Flurry" or "Arabesque" put an incredible load on the computer (you can hear the ventilators screaming after a while) so IMHO if you really need to, use "Message" as screen saver - but better set it to "Start after:" never. Or use this one: Screen Dimmer - Konstantin Anoshkin

                          • 10. Re: What would cause FMP to sleep so soundly?
                            Devon Braun

                            siplus, regarding screen savers, we actually avoid them entirely for the very reasons you described.  In fact, the idea behind our using "Display Sleep" was simply to turn the display off entirely, no screen saver necessary.

                            • 11. Re: What would cause FMP to sleep so soundly?
                              erolst

                              siplus wrote:

                              built-in screen savers like "Flurry" or "Arabesque"

                               

                              “Slightly” OT: remember “After Dark” of Flying Toasters fame, from the bad ol' Classic days?

                               

                              The new sss are nice enough, but I'm still looking for something that produces the effects of the “Satori” module. (A dose of recreational medicine plus a bit of “Satori” … ).

                               

                              Sadly, it's not included in any of the re-issues.

                              • 12. Re: What would cause FMP to sleep so soundly?
                                Devon Braun

                                siplus, that might be what it takes to shake the sloth off of FMP -- a quit and re-launch.  From what I can tell, the source of the problem is a combination of two settings associated with Display Sleep.  Display Sleep alone does not seem to effect FMP.  It's when on in conjunction with the "require password immediately after sleep or screen saver begins" option in System Preferences > Security & Privacy > General.  The two options together, for some reason causes Filemaker's On Timer script step and Looped scripts to stop running until the screen is reawakened.

                                 

                                I've tested on two computers with the same results.  Has anyone else experienced this?

                                • 13. Re: What would cause FMP to sleep so soundly?
                                  siplus

                                  lol what I remember is "not enough memory, switching to starry night"...

                                   

                                  in those times the app I mostly was into was ResEdit, and I can assure you that my Filemaker define field dialog was way better than yours and still better than today's one

                                  • 14. Re: What would cause FMP to sleep so soundly?
                                    siplus

                                    Well, I always nuked off any possible system-handled energy saving option, while trying to find out - via long poker sessions with Activity monitor as partner - who, when, what, for how long (and with google as partner: why) was fuelling my CPUs bar graphs. That path has dramatically reduced my experience with disgraces of the third kind like the ones you encounter.

                                    1 2 3 Previous Next