2 Replies Latest reply on Nov 24, 2015 8:00 AM by wimdecorte

    FMS13 fmsased Memory Leak - fmsased grows until restart when using scheduled scripts

    markvogan

      We are running FMServer13 on a dedicated Mac Mini server with 16GB RAM. We run scheduled scripts every hour or 4 hours. after a few days, fmsased - the script engine for the server - grows to exceed physical RAM. It starts to swap RAM onto the hard drive and performance degrades terribly.

      1. Is anyone else experiencing this?

      2. Is there a solution besides "Don't run scheduled scripts."?

       

      I wrote a script to test it:

       

      Set variable $Leak = 1

      Loop

      Set variable $Leak = $Leak + 1

      Exit Loop If $Leak = 1000

      End Loop

       

      Whenever this script runs, it pushes the $Leak variable to 1000, then it is gone at script termination because it is a local variable. The memory usage of fmsased increases by ~0.4MB each time, and it never goes back down. Shouldn't it go back down as there is nothing stored. I did not even update any records.

       

      Our database solution has several scheduled scripts such that the size of fmsased exceeds our physical memory every 5 days or so. Performance declines dramatically until we restart the fmsased file. Is there anything I can do besides restarting the script engine every few days?

       

      Any help is appreciated.

      Mark

        • 1. Re: FMS13 fmsased Memory Leak - fmsased grows until restart when using scheduled scripts
          mdiehr

          I've had similar problems with FMSAESD crashing in FMS14.   My solution is to use a simple shell script that tries to restart it every 10 minutes:

           

          #!/bin/bash

          echo '##################################################'
          echo '# FMSAdmin FMSE Restarter'
          echo '# will try to re-launch fmse every 10 minutes'
          echo '##################################################'

          while true
          do
              echo `date`
              echo '# Sleeping for 10 minutes'
              sleep 600
              echo '# issuing command - a 10006 error is normal, indicating the process was already running'
              cmd="fmsadmin start fmse"
              echo "$cmd"
              $cmd
              echo ""
              echo ""
          done

           

          You could probably adapt this script to actually kill the fmsaesd process (using kill -hup) or restart it (with the restart option), but if so you might only want to do that every 24 hour hours or so?

          • 2. Re: FMS13 fmsased Memory Leak - fmsased grows until restart when using scheduled scripts
            wimdecorte

            first thing to do would be to make sure you are on the latest FMS13 patch.  And if you have access to FMS14 then try that to see if anything got fixed along the way.

            Do report it to FMS support.

             

            I forget what it is now, but there is an OSX command line that will reclaim memory that has been used but is no longer.  OSX tends to hold on to that "recently used" in case it needs to be reused.  So perhaps running that on a schedule would solve the issue without affecting FMS.

             

            Having said that: restarting FMSE does not affect any connected clients so it should be safe to schedule that in between your normal script schedules...