Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Simple phonegap-android app becoming not-responsive

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: Simple phonegap-android app becoming not-responsive

    thnaks and test is in progress ...

    Comment


    • #17
      Re: Simple phonegap-android app becoming not-responsive

      regret to inform that the problem remain the same and everything slowed-down
      really badly

      Comment


      • #18
        Re: Simple phonegap-android app becoming not-responsive

        Resend your ux. What are the device specs you are testing it on?

        Comment


        • #19
          Re: Simple phonegap-android app becoming not-responsive

          While looking at the memory allocation in Chrome DevTools, I saw a potential problem with the onTimer event.
          So I think it would be better to get rid of the code in the onTimer event that runs the buttonClick() method on a button that no longer exists.

          EDIT: Nevermind, I found the SET_AUTO_TIMER button. Always so hard to use the find feature to find certain types of control IDs
          Last edited by jgrannis; 01-03-2019, 12:40 PM.

          Comment


          • #20
            Re: Simple phonegap-android app becoming not-responsive

            I would try to simply this UX significantly. It seems, and feels, like a jumble of Action Javascript statements, jumping around... a lot... and bound together with A5.executeThisThenThat() statements.

            There is also something odd going on with the A5.executeThisThenThan stuff. I'm not convinced this method is actually working the way it's used or intended. The doc declares that A5.executeThisThenThat() is for executing multiple Ajax Callbacks synchronously. But this app is not performing Ajax Callbacks.

            I would get rid of all the inline Javascript statements and simply run Javascript code on a button. Instead of using A5.executeThisThenThat()... use A5.runChain() instead. A5.runChain() was specifically built to run JavaScript functions synchronously.

            When I look at the elements of the app while it's running, the List html nodes look like they are being deleted, but LocalStorage is holding variable amounts of data... from 100 items to 700+ items... it's really odd. I might guess that stuff isn't running in the order it's intended.

            Comment


            • #21
              Re: Simple phonegap-android app becoming not-responsive

              To piggy back on what Jeff and David are saying, I'm wondering if it might be best to NOT always delete everything? Maybe delete only once the stored list has a certain number of records or based on some specified time interval. This use case is interesting and is a good test overall of memory management. Might be best, after streamlining it a bit, to take it to Selwyn and see what he has to say about it.

              Comment


              • #22
                Re: Simple phonegap-android app becoming not-responsive

                Originally posted by WebDesignShop View Post
                Resend your ux. What are the device specs you are testing it on?
                https://forum.alphasoftware.com/atta...9&d=1546459685

                Comment


                • #23
                  Re: Simple phonegap-android app becoming not-responsive

                  I’ve been running it for awhile (after having removed of those hide/show expressions) and see thousands of system objects getting created in memory and never deleted. Not javascript objects but system objects. I am kind of wondering if this isn’t one of those cases where by simply observing it (ie. building it in debug mode) modifies its behavior some. I say that because I was seeing a lot of those system objects had to do with debug information.
                  I was also seeing a lot objects getting created from $acn and $rcn and having to do with the hover class. But I haven’t figured out yet if those are contributing to the memory leak. I was wondering if it would be interesting to look into destroying the list object and re-initializing it instead of cycling through removing and then populating the rows.
                  Also, although this is obviously just a POC and the real app might not be replacing the list data completely like that every once in a while, is it really interesting to persist the list data to local storage?
                  Another solution might be to feed an array and use the array data to merge it with a template. Or maybe use a viewbox instead of a listbox. The listbox might have too much unused overhead functions that you aren’t using if you are just going to present the data to the user.

                  Comment


                  • #24
                    Re: Simple phonegap-android app becoming not-responsive

                    Originally posted by Davidk View Post
                    I would try to simply this UX significantly. It seems, and feels, like a jumble of Action Javascript statements, jumping around... a lot... and bound together with A5.executeThisThenThat() statements.

                    There is also something odd going on with the A5.executeThisThenThan stuff. I'm not convinced this method is actually working the way it's used or intended. The doc declares that A5.executeThisThenThat() is for executing multiple Ajax Callbacks synchronously. But this app is not performing Ajax Callbacks.

                    I would get rid of all the inline Javascript statements and simply run Javascript code on a button. Instead of using A5.executeThisThenThat()... use A5.runChain() instead. A5.runChain() was specifically built to run JavaScript functions synchronously.

                    When I look at the elements of the app while it's running, the List html nodes look like they are being deleted, but LocalStorage is holding variable amounts of data... from 100 items to 700+ items... it's really odd. I might guess that stuff isn't running in the order it's intended.
                    thanks David, will look at the ux carefully and provide update later on the day ...
                    it is supposed to be as simple as I can do it ...

                    no ajax
                    no sql
                    just plain static List
                    a random generated up to 999 records fed the empty list

                    a timer that cal it every xyz seconds ....

                    no intention iof involving any server or any external mean...
                    will probably do a call to a web site url to get a formula and on timer
                    the calculation to take place again and again base on timer ...

                    i just need to take care the slowed-down ...

                    i had inplenebt REBOOT every 2 hours and is working

                    BUT why cant i have this running continously or at least for 24 hours

                    Comment


                    • #25
                      Re: Simple phonegap-android app becoming not-responsive

                      Originally posted by jgrannis View Post
                      I’ve been running it for awhile (after having removed of those hide/show expressions) and see thousands of system objects getting created in memory and never deleted. Not javascript objects but system objects. I am kind of wondering if this isn’t one of those cases where by simply observing it (ie. building it in debug mode) modifies its behavior some. I say that because I was seeing a lot of those system objects had to do with debug information.
                      I was also seeing a lot objects getting created from $acn and $rcn and having to do with the hover class. But I haven’t figured out yet if those are contributing to the memory leak. I was wondering if it would be interesting to look into destroying the list object and re-initializing it instead of cycling through removing and then populating the rows.
                      Also, although this is obviously just a POC and the real app might not be replacing the list data completely like that every once in a while, is it really interesting to persist the list data to local storage?
                      Another solution might be to feed an array and use the array data to merge it with a template. Or maybe use a viewbox instead of a listbox. The listbox might have too much unused overhead functions that you aren’t using if you are just going to present the data to the user.
                      THANKS JEFF,

                      for your detail analysis ... there is no-doubt an interesting topic.
                      i had constructed more than 6 phonegap samples and all exhibit simialr slowed down.

                      again , its beyond me and hope someone could take the SIMPLE-UX and add/delete few codes
                      and shre it back here for further sharing ...

                      one of these days ... someone out there would need something running like what i am trying to experiment with.
                      thanks

                      Comment


                      • #26
                        Re: Simple phonegap-android app becoming not-responsive

                        Am I correct to understand this as being the flow?

                        1) button click SET_AUTO_TIMER
                        2) stop the timer
                        3) remove all rows (which basically just populates with an empty array)
                        4) refresh the list
                        5) button click REFRESH
                        a) stop the timer again
                        b) remove all rows again (which basically just populates with an empty array)
                        c) create data and populate list with the data
                        d) refresh the list again
                        e) set the status that fires off a bunch of hide/show calculations for various elements
                        6) call the set_timer function
                        a) call the startTime function
                        i) set the count down value
                        ii) setTimeout for a half a second and keep calling startTime every 500ms (does it ever stop? basically the same as setInterval, right?)
                        b) continue in the set_timer function while "fighting" with set-timer running every 500ms (probably runs slightly longer than 500ms because it means after 500ms stick the call to the end of the stack)
                        c) start timer
                        i) starting the timer triggers the onTimer event that calls buttonClick('SET_AUTO_TIMER') and then immediately stops the timer, etc.., etc...
                        But does that end up multiplying the number of different startTime loops that run every 500ms until you have it runnig every millisecond after a few hours?

                        Comment


                        • #27
                          Re: Simple phonegap-android app becoming not-responsive

                          Yeap, I put a little console.log() inside that startTime function and ran the thing every 3 seconds. Doesn't take long before it does nothing but run startTime()

                          Comment


                          • #28
                            Re: Simple phonegap-android app becoming not-responsive

                            You'll probably want to take the call to startTime() out of the loop and just call it once.
                            If needed, run it with var myVar = setInterval(myTimer, 1000); and then stop if needed with clearInterval(myVar)

                            To simplify that other part, maybe only call {dialog.object}.onTimerEventStart(interval) and pass in the interval dynamically.
                            No need for onTimerEventStop I think.
                            Just put return false in the beforeOnTimer event to stop it (for instance, if a button click set the status to 'stopped').

                            I personally would explicitly hide and show that extra info. when I call onTimerEventStart and just before the return false in beforeOnTimer.
                            I really don't like those hide/show expressions. I lose track of when they get recalculated. I prefer, in most cases, to know exactly when I need them to show or not.

                            Comment


                            • #29
                              Re: Simple phonegap-android app becoming not-responsive

                              Originally posted by jgrannis View Post
                              Am I correct to understand this as being the flow?

                              1) button click SET_AUTO_TIMER
                              2) stop the timer
                              3) remove all rows (which basically just populates with an empty array)
                              4) refresh the list
                              5) button click REFRESH
                              a) stop the timer again
                              b) remove all rows again (which basically just populates with an empty array)
                              c) create data and populate list with the data
                              d) refresh the list again
                              e) set the status that fires off a bunch of hide/show calculations for various elements
                              6) call the set_timer function
                              a) call the startTime function
                              i) set the count down value
                              ii) setTimeout for a half a second and keep calling startTime every 500ms (does it ever stop? basically the same as setInterval, right?)
                              b) continue in the set_timer function while "fighting" with set-timer running every 500ms (probably runs slightly longer than 500ms because it means after 500ms stick the call to the end of the stack)
                              c) start timer
                              i) starting the timer triggers the onTimer event that calls buttonClick('SET_AUTO_TIMER') and then immediately stops the timer, etc.., etc...
                              But does that end up multiplying the number of different startTime loops that run every 500ms until you have it runnig every millisecond after a few hours?

                              Thanks Jeff, just got into my work-space ....

                              a) call the startTime function
                              i) set the count down value
                              ii) setTimeout for a half a second and keep calling startTime every 500ms (does it ever stop? basically the same as setInterval, right?)

                              these 500ms never intended ! , let me see what/where that 500ms got called upon
                              will make some adjustment as close as possible to your recommendations

                              i will try re-post another UX sample

                              Comment


                              • #30
                                Re: Simple phonegap-android app becoming not-responsive

                                I CONSIDER THIS IS AN UN-SOLVED ISSUES ....

                                while i have not been able to make all those adjustments as outlined or suggested .
                                i come to a simple conclusion that despite trying to be as simple and as easy to have app developed
                                with alpha and phonegap ... we seem to see many hidden conflicts and errors generated in the background
                                which is beyond my ability to detect ...

                                i trust given time and more updates and proper reporting and investigations , these issues would be sddressed
                                and rectified in the "core" of the alpha developement .

                                i hope we will get more interest parties to put this simple-ux to a more serius modification and share back here
                                for the benefit of all ... there is no questions .... there will be slow down if you do like what i did ... a typical DIY person
                                with limited knowledge of all the pro-con of certain procedures or buttonclick to avoid or not using proper timer etc etc

                                for most of "us" , we go by what we can find in genie , there are so many ways to do it in alpha ...

                                THANKS everyone

                                Comment

                                Working...
                                X