14 Replies Latest reply on Oct 11, 2010 5:30 PM by KimBryner

    Runtime solution slow launch

    KimBryner

      Summary

      Runtime solution slow launch

      Product

      FileMaker Pro

      Version

      Advanced 11.0v2

      Operating system version

      Windows

      Description of the issue

      The database runtime solution is very slow to launch after initial installation on the target machine.  The database runtime solution is also very slow to launch after a re-boot or power down/up cycle.  I tried this on 3 computers each OS running XP SP3 but each having different RAM (256MB, 512MB, and 1GB).  By very slow, I mean it takes about 12 seconds until the login prompt appears, and then from the point of login entered to layout display, it takes about a full 5 minutes to completely initialize and get to the point of the first layout being displayed - this is for the 256MB RAM target machine and it takes about 2/3 of that time on the 1GB RAM machine.  This is just so slow.  During the time the solution is being launched/initializing, the screen appears to be a half painted screen, giving the impression the program isn't initializing correctly...but if you wait long enough, the layout will finally be displayed 4-5 minutes later.   What could be causing this?  My database has 4 tables.  One of the tables is pretty big (330,000) records, with about 5 fields in it being stored calculated values.  I have also written about 100 scripts, but only one runs on File Open Up.  I even tested out removing the script that runs of file open up, and that was not the problem.  What could make the launch/initialization that slow?

      Steps to reproduce the problem

      Ran same scenario on three target machines all with same OS but different RAM and each was still very slow to launch/initialize

      Expected result

      (1) Was expecting the user login prompt within 2-3 seconds of  double clicking on the runtime solution's desktop icon; (2) Was also expecting the time period from the point of user login entry to the time the first layout is dissplayed with record fully loaded to be another 10-20 seconds.
      (3) Was NOT expecting

      Actual result

      Tried on machines with different RAM (256MB, 512MB, and 1GB).  Results for 256MB RAM - about 12 seconds until the login prompt appears, and then from the point of login entered to layout display, it takes about a full 5 minutes to completely initialize and get to the point of the first layout being displayed.  Results for 1GB RAM - takes about 4 seconds until the login prompt appears, and then from the point of login entered to layout display, it takes about a full 2 minutes to completely initialize and get to the point of the first layout being displayed. This is just so slow.  Displayed during the launch/initi timeframe is a "half-painted" blank white screenwith blue border.  Also the slowness is only on the first launch/init; after that the time it takes for the next launch/init is reasonable with a total time of about 30 seconds.  But if the machine is powered off or rebooted, then the first launch/init after re-boot/power cycle is really slow again.

      Exact text of any error message(s) that appear

      No errors...just really slow.  If you try to close the FM window during launch/initialization (to exit the program), the FM window shows program as Not Responding and then there is not a graceful exit.  I had to uninstall & re-load the FM runtime solution from CD because it kept giving the "...file was not properly closed" message upon the 3 next launch/initialization attempts that I let run through completely to layout display.  COuld not get rid of the  "...file was not properly closed" message on 3 attempts, so I re-laoded the FMprogram from CD and problem solved.

      Configuration information

      XP SP3 on 3 platforms (one w/256MB RAM ; one w/512MB RAM ; one w/511GB RAM)

      Workaround

      None.  Getting frustrated with the long init times and realize it could be something I am doing wrong.

        • 1. Re: Runtime solution slow launch

          Kim Bryner:

          Thank you for posting.

          It seems that the slowness in this case is dependent on the RAM. What is the RAM and load time on your development machine? Have you tested your solution on a machine with the recommended 2GB of RAM?

          How large is your solution? When you load the solution, how much memory does the application appear to consume in Task Manager? Have you tried setting a different default layout to see if a particular layout or table could be causing the long load times?

          TSuki
          FileMaker, Inc.

          • 2. Re: Runtime solution slow launch
            KimBryner

            My developer workstation has the recommended 2GB RAM and is running Windows XP SP2 on a 2.8 GHz Intel Celeron processor. 

            I installed the FM solution on my developer workstation, performed a workstation reboot, waited one minute, and then launched the FM solution.  It took 12 seconds for the login screen to appear and took another full 2 minutes and 3 seconds to load.  Memory usage in the Task Manager shows 98,000K (or about 96MB if you divide by 1024). 

            I am going to make a "dummy" layout with only a button on it and see how long that takes to load.

            • 3. Re: Runtime solution slow launch
              KimBryner

              I made a "dummy" layout with only a simplistic button on it and also showing six fields from Table 4.  Table 4 is a small table with only 1 record and about 20 fields, most of which are used as global variables (stored).  Sure enough, the simple "dummy" layout loaded in only one second. 

              So I added a script to the button on the dummy layout, with the script programmed to goto the Home Page...I did this so I could see the memory usage change in the Task Manager....here are the stats, with no other programs running on my workstation (2GB RAM, 2.8 GHz processor, XP SP2):

              Time from clicking on desktop icon to FM login prompt is about 12-16 seconds and Task Manager's memory usage shows 87MB for the database solution.  Time from login entry to "dummy" page load is about 1-2 seconds and Task Manager's memory usage after page load shows 90.3MB for the database solution. Time from button click on "dummy" page until Home Page load completes is about 110-125 seconds and Task Manager's memory usage after Home Page load shows 90.7MB for the database solution.

              So where the big delay occurs is when I load my "Home Page" - it takes about 110-125 seconds to load this page.  This Home Page displays 64 fields from Table 1.  None of the fields in Table 1 are calculations...all the fields are text or numbers, but Table 1 is very big as it contains 330,000 records.  Each record has 84 fields, and about 35 of the fields are setup as indexed (All).  The rest are setup as No indexing.  My Home Page also has about 12 buttons on it.  Each button is setup to hide when printing, and each button has a script associated with it, but those scripts do not execute until you click on the button.  There is also one field from Table 2 (text) shown on the Home Page and about 4 fields from Table 4 (text, globals).

              So what do you think is causing the problem that takes my Home Page so long to load? 

              • 4. Re: Runtime solution slow launch

                Kim Bryner:

                There could be an issue with the number of fields or records. Are there any layout objects besides the field objects? What happens if you test with a clone of the database? What is the filesize of the database?

                TSuki
                FileMaker, Inc.

                • 5. Re: Runtime solution slow launch
                  philmodjunk

                  Any conditional formats set in this layout? Any of them use expressions such as an aggregate function that may need to evaluate based on data from more than one record?

                  If all else fails, you might try making several copies of your layout and delete a different portion of the layout design from each one and then check to see which one loads the quickest. From there, you can zero in on the items you deleted from this layout to see if there's something there that might require more time to evaluate and display.

                  • 6. Re: Runtime solution slow launch
                    KimBryner

                    I have figured out what the problem is...the big delay of 115-125 seconds only occurs after initial installation of my solution or upon re-boot/power cycle of the workstation when the FIRST Printer Setup command is executed.

                    My Home Page layout setup properties are set such that a script called "Change to Landscape" runs upon layout enter - it changes/sets the page orientation so that the Home Page layout is displayed in landscape, and does this by performing the Print Setup command to set the page orientation to landscape (w/no dialog shown so that it is hidden from the User).

                    My solution requires some layouts to be viewed/printed in portrait and some in landscape, so I have two scripts - one called "Change to Portrait" and one called "Change to Landscape" - each uses the Print Setup command to set the page orientation accordingly.  For layouts that need to be viewed in landscape, the layout setup is set to call the script "Change to Landscape" upon layout entry. For layouts that needs to be viewed in portrait, the layout setup is set to call the script "Change to Portrait" upon layout entry.

                    So I changed my Home Page layout to no longer run the script "Change to Landscape" upon layout entry, but then found that then the first time the User clicks on a print button on the Home Page or switches to another layout, the same long 115-125 second delay occurs because the root cause of the problem is execution of the FIRST Printer Setup command.  Again, this long delay only occurs after initial installation of my solution or upon re-boot/power cycle of the workstation when the FIRST Printer Setup command is executed.  Navigation/printing thereafter occurs quickly (in 1-2 seconds).

                    Any ideas for a work-around?

                    • 7. Re: Runtime solution slow launch

                      Kim Bryner:

                      That seems like a long time for a printer setup to occur. Is the printer attached to the machines or is it on the network? It seems that once the printer is initialized on the machine, the delay does not occur until the machine is rebooted. Is there a delay when you try setup the printer or print in other applications? Does this seem to initialize the printer and prevent the delay when you open the runtime? You may want to try various printers or print options to see if either is causing the delay.

                      TSuki
                      FileMaker, Inc.

                      • 8. Re: Runtime solution slow launch
                        philmodjunk

                        Sounds like the referenced printer is connected to your development machine but isn't present on the machine where you are testing the runtime version. Correct?

                        • 9. Re: Runtime solution slow launch
                          KimBryner

                          New finding is that the problem is related only to Print Setup when called from a script.  If I manually perform File, Print Setup from the main menu, there is no delay (1-2 seconds); however, even after doing this, the first time Print Setup is called from a script, the long delay occurs. 

                          Seeing that the delay does not occur if the Printer Setup is accomplished manually, this got me thinking about the Printer Setup command that gets called from the script...what path/where does it go to look for the printer info if the Print Setup is called from a script vs. done manually (again, where does it go look the first time vs. next time)? How does it store or capture info about a printer and where is that info is stored?  Does that storage location get nulled out on an install or a reboot?  What is the expected behavior if the computer has no printers installed?

                          ---In regards to TSuki...

                          That seems like a long time for a printer setup to occur. Is the printer attached to the machines or is it on the network? Printer is attached to the machines; description of test setups is provided below.  It seems that once the printer is initialized on the machine, the delay does not occur until the machine is rebooted. Is there a delay when you try setup the printer or print in other applications? No delays are experienced when I do Print Setup using other programs nor if I do it manually from the main menu within the FM solution (i.e., got main menu, select File, Printer Setup).  Does this seem to initialize the printer and prevent the delay when you open the runtime? No, this does not help.  If I do Print Setup from another application, it does not help, nor does it help when I do Print Setup from the FM main menu.  You may want to try various printers or print options to see if either is causing the delay.

                          ---In regards to PhilModJunk...

                          Sounds like the referenced printer is connected to your development machine but isn't present on the machine where you are testing the runtime version. Correct?  No, the printer is attached to the machines; description of test setups is provided below.

                          ---

                          Here's a description of my test setups - each has the same results - long delays the first time Print Setup is called from a script (after install or after reboot).

                          Test setup1: My development workstation (XP SP2, 2GB RAM, 2.8GHz) is connected to an OKI 5100 color laser jet printer that connects directly to my workstation (via a USB switch).  The delay is almost 2 full minutes on this machine.    

                          Test setup2: I have another desktop (XP SP 3, 512MB RAM, >1GZ) and it has the same OKI 5100 printers installed on it (goes through the same USB switch) - the delay is almost 4 minutes minutes on this machine.

                          The OKI 5100 printer is not shared on a network - the printer can only be connected to one computer at a time via the pushbutton style USB switch. There aren't any other delays in talking to the OKI 5100 printer when other applications use it.

                          Test setup3: I have a laptop (XP SP 3, 256MB RAM, >1GHz) and it has NO printers installed - the delay is a little more than 4 minutes on this machine.

                            Yoru help is appreciated and your questions are thought provoking.  Keep them coming please.

                            

                           

                           

                          • 10. Re: Runtime solution slow launch
                            KimBryner

                            ---Let me clarify something about my last post----

                            New finding is that the problem is related only to Print Setup when called from a script.  If I manually perform File, Print Setup from the main menu, there is no delay (1-2 seconds); however, even after doing this, the first time Print Setup is called from a script, the long delay occurs. 

                            -----

                            Scenario 1: My Home Page comes up and the default Printer Settings are: OKI 5100, Portrait, letter 8.5 x11, automatically select the paper tray. 

                            --test 1a: If I manually select Printer setup from the main menu and I do not change these settings and just click OK, then there is no delay. 

                            --test 1b: If I manually select Printer setup from the main menu and I CHANGE these settings to Landscape, then the delay occurs.

                            Scenario 2: My Home Page comes up and the default Printer Settings are: OKI 5100, Portrait, letter 8.5 x11, automatically select the paper tray. 

                            --test 2a: If I click on a test button that calls Printer Setup from a script and the settings in the command are the same (OKI 5100, Portrait, letter 8.5 x11, automatically select the paper tray), then I experience the delay.

                            --test 2b: If I click on a test button that calls Printer Setup from a script and the settings in the command are different (OKI 5100, Landscape, letter 8.5 x11, automatically select the paper tray), then I experience the delay.

                            So the behavior when calling Printer Setup is a little different if run from a script vs. run from the main menu.

                            -------

                            I also upgraded my developer workstation to XP SP3 and retested after that and got same results.  I will be offline for about a week and will check back in a week.

                            • 11. Re: Runtime solution slow launch
                              TSGal

                              Kim Bryner:

                              Thank you for your post.

                              Perhaps the "Print Setup" script step is damaged.  Remove it, replace it with another "Print Setup" script step, set the printer and save it.  Try running the script again.

                              If the above doesn't work, and if the entire script is damaged, create a new script "SETUP" that solely has the "Print Setup" script step.  Then, in your original script, remove (or disable) the "Print Setup" command and insert Perform Script command, and call the new Print Setup script "SETUP".  Does this work?

                              Please continue to keep us updated with any progress.

                              TSGal
                              FileMaker, Inc.

                              • 12. Re: Runtime solution slow launch
                                KimBryner

                                Back in town and picked up on the testing.  It appears the problem was being caused by my printer's driver...and it also looks like because the driver I used was bad, I now have to go into every script and remove & replace the Print Setup and Print statements...so that is what I plan to do tomorrow.  I will post results. 

                                I also compacted the file, but I did a test after only compacting it and before the printer driver change and the long delay with Print Setup still occurred.

                                Printer Driver Update Notes:  To update my print driver I went to the printer manufacturer's website and downloaded the latest revision of the printer's driver (instead of letting Windows on my workstation automatically find a printer driver for me- it found and installed an older one than the manufacturer had available on their website).      Make the Print Setup changes in this order: remove the Printer Setup and Print statements from the script, save & close script, open same script, add in the same Print Setup and Print statements that were just removed, save & close script.  

                                 

                                • 13. Re: Runtime solution slow launch
                                  KimBryner

                                  Testing today confirmed the root cause of the problem was the bad/old print driver.  As a result of the bad printer driver, I had to change out the Print Setup & Print statements too.

                                  To recap the original problem: Problem was slow launch on initial install and after reboot/power cycle.  Problem symptoms were misleading in that they appeared to be related to a memory usage/data size issue (launched fast with few records, launched much slower when exceeding 100K records, super slow launch when 330k records in my table; also longer delay as more data was added into each records; same symptoms w/only little improvement after compacting file/removing blank space).  

                                  To recap the solution:  Root cause was bad/old print driver.  Removed printer (from Control Panel), also removed printer driver from driver's list.  Next, went to printer manufacturer website and downloaded latest driver, then added printer (from Control Panel using have disk/file option & pointed to printer driver I downloaded).  Lastly, went into every script where a Print Setup or Print command was called and deleted those statements, saved & closed scripts, opened scripts back up, added in new Print Setup and Print commands (that are now are associated with my updated printer driver), saved & closed scripts.  Recreated runtime solution & problem was gone (time to initial login is now about 12 seconds, time to load Home Page including calling the Print Setup statement is only about 2 seconds).

                                  It was really strange how my printer worked fine with every other app I have installed except for FM when called from a script. 

                                  TSuki, TSGal, PhilModJunk - thanks for your support in helping me troubleshoot this problem, as I am relatively new to Filemaker. 

                                  • 14. Re: Runtime solution slow launch
                                    KimBryner

                                    Update:  Problem of a big delay is not totally solved yet.  Now the big delay occurs when any script encounters the very first Print statement (again problem only after initial install or reboot/power cycle)...so the problem moved from Print Setup to Print now. 

                                    My printer has no problems with other apps, so I'm not sure what the problem is,; however, the "attention" light on it just came on today with a message that its belt life is near the end so I am thinking of getting another printer (a loaner), maybe HP and test out a few things.    I have not yet tried Print from the main menu to see if there is a delay there too.