Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Out of memory after opening two simple forms, what gives?

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

    Out of memory after opening two simple forms, what gives?

    Alpha Five is generating an error message "Out of Memory" for an extremely simple opening and closing of a child form from a parent form.

    The child form contains a button with the following action script:
    Code:
    Save record in current form at parent level
    Close current form or browse window
    Close the current window
    When I clicked on the button on the child form, the form disappeared as desired.

    However, at the bottom of the screen, the tab, which is created for each form as it was opened, did NOT close.

    I thought this was weird, and opened my child form and closed it three times using its button.

    But the tab at the bottom of the screen still would not close.

    Finally I right clicked on the tab, and selected Close All.

    At that point, Alpha Five returned the error message.

    I repeated this same exercise with the Windows XP task manager open just to monitor my laptop's memory.

    I am using an IBM Thinkpad T42 with 2 GB of memory. Throughout all of my testing, the Windows task manager reported statistics like the following:

    Code:
    Physical Memory (K)
    Total 2096048
    Available 1489788
    System Cache 731952
    I interpret these statistics to mean that of my 2 GB of available memory, I have roughly 1.4 GB of memory of available. I noted NO spikes in Alpha's use of memory.

    If that is the case, does any one know why Alpha Five generated its "Out of memory" error message when Windows Task Manager shows plenty of memory available.

    More importantly, how does one close a form to remove it from memory. I resorted to two different close statements in my action script, but apparently they were not sufficient.

    Bob McGaffic
    Pittsburgh

    #2
    Re: Out of memory after opening two simple forms, what gives?

    I can hear G Gabriel now: "I told you so!" or insight five minutes later.

    Here's what's causing the problem:

    The parent form button which calls the child form has the following XBasic behind it:

    Code:
    Dim LinkDef As C
    LinkDef = "Topic_id = " + s_quote(mTopic_Id)
    Dim p as P
    p = Form.ViewLinked("frmTopicItem", LinkDef, "", "", "dialog", "center", "center")
    Simple, easy to be sure -- BUT IS IT STABLE? It looks like it's consuming lots of system resources, but I'm not seeing that looking at the Windows Task Manager which shows roughly 2/3 of my laptop's 2 GB as available.

    My parent form also contains another button for opening a form using an action script. The form is closed by click on the Windows Window X icon. When the form is closed, the tab disappears. This is the behavior I expected.

    Bob McGaffic
    Pittsburgh

    Comment


      #3
      Re: Out of memory after opening two simple forms, what gives?

      Bob,
      You are opening the form as a dialog....and then closing it say via a close button on the form. This is a very prevalent mistake made. You only closed the form from view--it is still in memory. A form opened as dialog works this way so that additional code/scripts can run after the form is closed from view but is still actually present (in memory)--it does this by pausing the script once the form opens (is shown). The paused script resumes when the opened form is closed.

      IMPORTANT!!! Whatever script opened the form ALSO has to close the form that has been opened as a dialog (the calling script). So yes, you are closing the same form twice--once from view and the next from memory. Most times, if Action Script is used, it will place the appropriate closing in the calling script....but have had to, on occaision, added my own "Close Window" action script I remember.
      Mike
      __________________________________________
      It is only when we forget all our learning that we begin to know.
      It's not what you look at that matters, it's what you see.
      Henry David Thoreau
      __________________________________________



      Comment


        #4
        Re: Out of memory after opening two simple forms, what gives?

        Miike,

        Thanks for the clarification.

        I adopted your suggestion, but unfortunately, the "Out of memory" problem remains even after the child form is opened and closed ONE time.

        Here's summary of the problem:

        mTopic_Id is defined as variable

        Code:
        [FONT="Courier New"][B]Parent form: frmTopic
          Parent button
            Execute inline XBasic code
              Dim LinkDef as C
              LinkDef = "Topic_id = " + s_quote(mTopic_Id)
              Dim p as P
              p = Form.ViewLinked("frmTopicItem", LinkDef)
            Close the form/browse called: frmTopicItem[/B][/FONT]

        Code:
        Child form: frmTopicItem
          Child button
            Save record in current form at parent level
            Close current form or browse window
        You can see that I have indeed closed the form frmTopicItem twice per your suggestion. Yet the "Out of memory error" remains.

        Then I added changed the child forms as follows:
        Code:
        Child form: frmTopicItem
          Child button
            Save record in current form at parent level
            Close current form or browse window
            Close the current window
        The problem remains. Note the child form contains an embedded browse which displays 3 child records.

        Note the screen print below shows Windows Task Manager showing that plenty of memory is available.

        Why is something this small and simple, so quickly exhausting Alpha Five's resources?

        Bob McGaffic
        Pittsburgh, PA
        Last edited by rmcgaffic; 03-25-2009, 02:24 PM.

        Comment


          #5
          Re: Out of memory after opening two simple forms, what gives?

          Bob,
          If you do not have multiple instances of the form opened (signified with numeric suffixes after the form names), then the form that is being opened as dialog is being closed as it should be. Your script you last posted opens the form normally (not as dialog).

          As is said so many times here--a sample will always get a quicker, more specific response and makes it so much easier for everyone to be on the same page right away....even for what apparently is an "easy" question! :)

          BTW--I don't open bitmaps on this PC as it is for some reason a 3 step process for me--even when it is not it does take longer than a JPG or PNG which is mostly recommended for the messageboard.
          Mike
          __________________________________________
          It is only when we forget all our learning that we begin to know.
          It's not what you look at that matters, it's what you see.
          Henry David Thoreau
          __________________________________________



          Comment


            #6
            Re: Out of memory after opening two simple forms, what gives?

            Tom,

            Thanks for the pointers. I use .bmp image files, because Alpha typically uses this format.

            Attached is a zipped application.

            Here's how to reproduce the "Out of memory" error:
            1. Doubleclick on frmTopic to open it in full screen mode
            2. Click on the [Continue] button to move to the second record with a topic_id of AA2.
            3. On record AA2, click on[List] button.
            4. frmTopicItem opens in dialog form.
            5. Note that three records are displayed.
            6. Click on [Save+Exit] button on the dialog form
            7. Out of memory message box is displayed and tab for frmTopicItem at the bottom of the screen is not closed

            That's it in a nutshell. I've incorporated your suggestion and have closed the dialog form twice on both the target form and the calling form.

            Thanks,
            Bob McGaffic

            PS: If you double click on a line in the dialog form frmTopicItem, another form opens also in dialog mode frmTopicItemDetail.

            Here's the idea:
            frmTopic: Describes a topic, for example, characteristics of people we dislike. The user is instructed to click on the[List button]

            frmTopicItem: The user has an opportunity to list the behaviors of people he dislikes in a list. The important idea is to capture this information as quickly as possible, like typikng a list in an Excel spreadsheet. Fields Topic_Id and Item_No are both included in the browse, but their column width is set to zero: hence the need for the form.viewlinked().

            frmTopicItemDetail: Once the user completes his list, he can doubleclick on any item and open a new dialog form, where he can describe in detail why a particular behavior is disliked.

            So two dialog forms and the parent form may be open at one time. I'm running into my memory problem with just one dialog form open with the parent form.

            Gilbert & Sullivan's Mikado never was able to use Alpha Five, but if he had, I'm sure he would use an application like mine to create a list of objectional behaviors, "a list of people who would not be missed" including those who puff peppermint in your face.
            Last edited by rmcgaffic; 03-25-2009, 10:13 PM.

            Comment


              #7
              Re: Out of memory after opening two simple forms, what gives?

              Bob,
              Sorry but I cannot test with your form as the ActiveX object is based on I believe CtTree which I do not have.

              But, I could see your scripts on the buttons. On your List button you used a form/browse close action script. Instead try what I stated and use a Window Close---Action Script left pane of Select Action would be Window Commands, right pane would be Close Window->select "Specify the Window Name" (if you have the dialog form open it will list its name).

              Without being able to test your forms this is about all I can help with...
              Mike
              __________________________________________
              It is only when we forget all our learning that we begin to know.
              It's not what you look at that matters, it's what you see.
              Henry David Thoreau
              __________________________________________



              Comment


                #8
                Re: Out of memory after opening two simple forms, what gives?

                Mike,

                You don't need the ctTree Control. I should have deleted for you.
                It simply populates a tree control with a little more graphic flexibility than native A5 permits.

                If you click on a record in the tree, the record will be displayed in the form.

                But another way is to use the [Back] and [Continue] buttons. That's why I suggest click on [Continue] to advance to the second record in the database and then click on[List].

                Bob McGaffic
                Pittsburgh, PA

                Comment


                  #9
                  Re: Out of memory after opening two simple forms, what gives?

                  Tom,

                  Boy, this isn't easy!

                  I removed the ctTree control and commented out the OnInit code I used to populate the tree.

                  The control's OnClick event was as follows:
                  Code:
                  function click as v ()
                    dim mNode as N
                    dim mTopic_Id as C
                    mNode = ctTree1.Selected  
                    mTopic_Id = ctTree1.NodeCargo(mNode)
                    topparent.Index_SetExplicit("Topic_Id")
                    topparent.find(mTopic_Id)	 
                  end function
                  This code is used to select the form to display once a node is clicked on.

                  This code beautifully populated the tree and was superfast with lots more graphic properties compared to the native Alpha tree.

                  Once this control was removed, and once the child form's [Save+Close] button has an action script as follows:
                  Code:
                  Save record in current form at parent level
                  Close the current window
                  And the memory error does does NOT occur.

                  Note that the tree control only had three nodes displayed, which couldn't take that much memory. And why did Windows Task Manager never display even a blip in memory use?

                  What an enigma!

                  Thanks for taking a look at my zipped file.

                  Bob McGaffic
                  Pittsburgh, PA
                  Last edited by rmcgaffic; 03-25-2009, 11:40 PM.

                  Comment


                    #10
                    Re: Out of memory after opening two simple forms, what gives?

                    I have come to the conclusion I have no clue as to what the problem is and just want to vent some tea kettle like frustration:

                    1. Is the problem the third party ActiveX tree control (ctTree by Codejock)?

                    No, because when I open child frmTopicClue in dialog mode, then close this form using the Windows title X, the form correctly closes, and the tab at the bottom of the screen disappears.

                    No, because when I open child frmTopicExample in dialog mode, then close this form using the Windows title X, the form correctly closes, and the tab at the bottom of the screen disappears.

                    SO if both of these forms can be opened and closed cleanly without invoking a memory error, it is unlikely that the ctTree control is the problem

                    2. Is the problem the Form.ViewLinked() method from Alpha Five?

                    No, because when the ctTree control is removed and the parent's OnInit code is commented out, the Form.ViewLinked() method allows child form to be opened successfully, and the Close the current window in the child form behaves as it should and the tab at the bottom of the parent form correctly disappears.

                    3. Is the problem Alpha Five in general?

                    Any add, change, delete activites in the child frmTopicItem are correctly written to the database.

                    The error message is a dialog box with the following format:
                    Windows title: Error
                    Icon: Blue i in a cartoon ballon shape
                    Message: Out of memory
                    Button: OK

                    Wouldn't you think an Alpha error would be displayed with a white X in a red circle icon?

                    And get this: When I click on the Windows title X to close the Error message dialog, it closes, but the tab at the bottom of the form remains. Then when I click on the button to open child form frmTopicClue, a new tab for frmTopicClue is not displayed at the bottom of the form and the frmTopicItem tab moved to the right, as you would expect. Rather the tab that is "stuck" for frmTopicList is overwritten with frmTopicClue.

                    The records written to the database with the form.ViewLinked() method all appear to be OK.

                    So this seems to not really be an error, but really weird behavior. Yes, I would like the tab to disappear when the form is closed, but confronting a user with a benign Error message does not make for a good user experience.

                    Enough for tonight!

                    Bob McGaffic
                    Pittsburgh, PA

                    PS: My fear is that this is really very unstable and I don't know why.
                    Last edited by rmcgaffic; 03-25-2009, 11:41 PM.

                    Comment


                      #11
                      Re: Out of memory after opening two simple forms, what gives?

                      Bob,
                      I took another look and tried a few things as well.

                      I can open and close the frmTopicItem as a normal form with no problems.

                      I can open and close the frmTopicItem as a dialog form with no problems.

                      But when I use the Form.ViewLinked() I get the same error as you. The form opened in this manner is not allowing any way to close itself so perhaps there is something about opening up a form in this manner that has not been learned or documented as of yet.

                      Question...why are you using the Form.ViewLinked() method as I do not see any problem whatsoever in utilizing the other two methods??

                      Also---I think you are taking the error message as literal when perhaps it should not be--some error messages, when found out what has caused them appear cryptic....until they have been fully explained and sometimes it is only when the powers that be {Alpha} come in to do this explaining that they make sense.
                      Mike
                      __________________________________________
                      It is only when we forget all our learning that we begin to know.
                      It's not what you look at that matters, it's what you see.
                      Henry David Thoreau
                      __________________________________________



                      Comment


                        #12
                        Re: Out of memory after opening two simple forms, what gives?

                        Tom,

                        You asked why I was using ViewLinked() instead of just opening a browse.

                        On frmTopicItem, the browse contains three fields:
                        Topic_Id
                        Item_No
                        Item_Text

                        The first two fields are set to column width of zero, so when the user opens the form, only the Item_Text field field is displayed. As I mentioned previously, I want this list to behave like an Excel spreadsheet for quickly compiling a list.

                        However, all added records should be populated with the Topic_Id from the parent form automatically. And that is what form.ViewLinked() is intended to do.

                        OK, here's the rub: formViewLinked() was made available in version 8. I am using version 9 with the latest patches. When I search the help ("Alpha Five Help/Alpha Five Version 9 dated 03/18/2008), incredibly there are no hits!!! Should we read something into this (the functionality does work in version 9) or is it simply an omission?

                        Had it not been for a posting of Tim Kiebert (thread: Populating child record with parents ID) I would never know this function exists.

                        The only documentation I can find is what Tim cut and pasted from his V8 help. This documentation does not mention any specific action needed to close or revoke form.ViewLinked()

                        One or two messages back, you mentioned that my code behind the button on the parent form did not include Closing the window for frmTopicItem. Light bulb goes on. You must have both windows open on your desktop, frmTopic and frmTopicItem, before you can Action Script a Close Window for frmTopicItem. I did successfully add an action script line to close child frmTopicItem in the code behind the button on the parent frmTopic.

                        In summary here's what I think is happening:

                        Click on parent form button[List]
                        Child form opens in dialog mode
                        Click on [Save+Close] button on the child form.
                        Child form closes correctly
                        Error message "Out of memory is received"
                        Child form tab is still visble at the bottom of the screen
                        The ViewLined code hangs and Alpha will not execute the second Close child window command
                        Click on parent form button [Clue]
                        This action forces the execution of the execution of the second Close child window command that you recommended
                        At the bottom of the page the tab for frmItemTopic disappears and is replaced by a tab for frmItemClue.

                        This looks like a bug to me, especially since my monitoring of memory usage using Windows Task Manager shows no spike or peak levels of usage.

                        Bob McGaffic
                        Pittsburgh
                        Last edited by rmcgaffic; 03-26-2009, 10:35 AM.

                        Comment


                          #13
                          Re: Out of memory after opening two simple forms, what gives?

                          This looks like a bug to me.
                          If formViewLinked() is supposed to work when opened as dialog the same way as .Form_View() is for a dialog form then I agree....but without complete documentation I cannot say for sure.
                          Mike
                          __________________________________________
                          It is only when we forget all our learning that we begin to know.
                          It's not what you look at that matters, it's what you see.
                          Henry David Thoreau
                          __________________________________________



                          Comment


                            #14
                            Re: Out of memory after opening two simple forms, what gives?

                            Bob,

                            I have no help for your problem but just thought you should know that all the help you have been getting is from MikeC even though you keep addressing your posts to Tom.

                            Comment


                              #15
                              Re: Out of memory after opening two simple forms, what gives?

                              I had to laugh at Doug's post because I was thinking the same thing!

                              Bob,
                              Have the list button script be this:

                              Code:
                              Dim LinkDef As C
                              LinkDef = "Topic_id = " + s_quote(mTopic_Id)
                              Dim ptr as P
                              ptr = Form.ViewLinked("frmTopicItem", LinkDef, "", "", "dialog", "center", "center")
                              
                              if is_object(ptr) = .t. then 						
                              	ptr.close()
                              end if
                              Mike W
                              __________________________
                              "I rebel in at least small things to express to the world that I have not completely surrendered"

                              Comment

                              Working...
                              X