Quantcast

Deleting stacks on the fly

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Deleting stacks on the fly

Mark Talluto via use-livecode
I'm trying to optimize for minimal RAM usage on mobile. The app is modular with many stacks that are opened from the mainstack.

I had this before in a global library:

command portal_GoStack stackName
-- goes to the new stack
-- closes the current stack # But we want to delete it to clear RAM
-- safely ignores if we are alrady in the new stack
put the short name of this stack into oStackName
if oStackName = stackName then return oStackName
go to stack stackName
--close stack oStackName
-- test deleting the stacks to save on RAM
delete stack oStackName
return oStackName
end portal_GoStack

This is called from a button on a navigation bar of the stack we want to close and delete, as it opens a different stack.

This works if we just use "close stack oStackName"

but if I change this to "delete stack oStackName"

we get an error: stack "lib_SivaSivaPortal": execution error at line n/a (Object: stack locked, or object's script is executing) near "widget "go-home-portal" of group "homeScreensBottomNav" of card "images-quotes" of stack "/Users/Brahmanathaswami/Documents/_Siva-Siva-App/modules/gems/gems.livecode""

Obviously this means that the stack "gem.livecode" which has the button which is trying to "navigate" back to the home/main stack, cannot be deleted because the button script that calls the library handler is considered to be executing.

Closing it first before deleting does not help.

so I tried using "send in 10 milliseconds"  And this *does* work.. I'm just trying to see if this is best practice. both stacks will occupy RAM briefly, but  there is no other way that I know of to avoid this without a "flash" of some empty screen.

command portal_GoStack stackName
-- goes to the new stack
-- closes the current stack
-- safely ignores if we are alrady in the new stack
put the short name of this stack into oStackName
if oStackName = stackName then return oStackName
go to stack stackName
send "removeStack oStackName" to me in 10 milliseconds
return oStackName
end portal_GoStack

command removeStack stackName
delete stack stackName
end removeStack


Stack A opens
Stack B opens on top
Stack B want to close itself, be deleted (removed from memory) and open stack A

Anyone has gone through this loop already and discovered best practices to accomplish this?

BR

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cross platform font symbols & quality

Mark Talluto via use-livecode
I have always liked Trebuchet as a cross platform font, just nudging the size up by 1 point on Windows and leaving a bit of breathing space in fields.  However, I have encountered a few problems in my latest project which has a lot of rather closely packed fields, and needs smaller font sizes than I normally use.

1/ Trebuchet at small font sizes  (10 - 12) looks OK on Mac but horrible on Windows.  I assumed there would be no problem because of the font’s origins.  It is definitely installed on my Win test box, so it isn’t a substitution issue.  Weirdly, if the card is scaled to fullscreen, the same font sizes seems to look much better - not just bigger.

2/ I use the null symbol a lot, which appears fine on Mac, but as the dreaded rectangle on Windows.  Is this the MacOS making it look like null is available in Trebuchet, when actually it isn’t by substituting from symbol?  If so, how do I tackle this issue?

3/  I use male and female symbols downward cross female, and diagonally upward arrow.  These appear on both platforms, but look horrible on Windows (faint and jagged), even if I use Arial.


Win XP, Vista & 10
Mac 10.12
LC 7.1.3

Any advice?

Best wishes,

David Glasgow
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
In reply to this post by Mark Talluto via use-livecode
FWIW, tested on an android device with plenty of memory

Deleting stacks isn't helping. My Nexus 5 has 1 GB free RAM even with all of Google's widgets and my app open and going from Stack B back to stack A then deleting StackcB in 10 milliseconds  is "nothing" in terms of memory requirement, but crashes in Android every time…

I have a report in to HQ…

 

On 2/11/17, 8:38 AM, "use-livecode on behalf of Sannyasin Brahmanathaswami via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    I'm trying to optimize for minimal RAM usage on mobile. The app is modular with many stacks that are opened from the mainstack.
   
    I had this before in a global library:
   
    command portal_GoStack stackName
    -- goes to the new stack
    -- closes the current stack # But we want to delete it to clear RAM
    -- safely ignores if we are alrady in the new stack
    put the short name of this stack into oStackName
    if oStackName = stackName then return oStackName
    go to stack stackName
    --close stack oStackName
    -- test deleting the stacks to save on RAM
    delete stack oStackName
    return oStackName
    end portal_GoStack
   
    This is called from a button on a navigation bar of the stack we want to close and delete, as it opens a different stack.
   
    This works if we just use "close stack oStackName"
   
    but if I change this to "delete stack oStackName"
   
    we get an error: stack "lib_SivaSivaPortal": execution error at line n/a (Object: stack locked, or object's script is executing) near "widget "go-home-portal" of group "homeScreensBottomNav" of card "images-quotes" of stack "/Users/Brahmanathaswami/Documents/_Siva-Siva-App/modules/gems/gems.livecode""
   
    Obviously this means that the stack "gem.livecode" which has the button which is trying to "navigate" back to the home/main stack, cannot be deleted because the button script that calls the library handler is considered to be executing.
   
    Closing it first before deleting does not help.
   
    so I tried using "send in 10 milliseconds"  And this *does* work.. I'm just trying to see if this is best practice. both stacks will occupy RAM briefly, but  there is no other way that I know of to avoid this without a "flash" of some empty screen.
   
    command portal_GoStack stackName
    -- goes to the new stack
    -- closes the current stack
    -- safely ignores if we are alrady in the new stack
    put the short name of this stack into oStackName
    if oStackName = stackName then return oStackName
    go to stack stackName
    send "removeStack oStackName" to me in 10 milliseconds
    return oStackName
    end portal_GoStack
   
    command removeStack stackName
    delete stack stackName
    end removeStack
   
   
    Stack A opens
    Stack B opens on top
    Stack B want to close itself, be deleted (removed from memory) and open stack A
   
    Anyone has gone through this loop already and discovered best practices to accomplish this?
   
    BR
   
    _______________________________________________
    use-livecode mailing list
    [hidden email]
    Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
    http://lists.runrev.com/mailman/listinfo/use-livecode
   

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
On 2/14/17 12:00 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
> Deleting stacks isn't helping. My Nexus 5 has 1 GB free RAM even with
> all of Google's widgets and my app open and going from Stack B back
> to stack A then deleting StackcB in 10 milliseconds  is "nothing" in
> terms of memory requirement, but crashes in Android every time…

My other project is crashing on Android the same way. It also has heavy
server/internet use. I'm starting to think that's where the problem lies.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
In reply to this post by Mark Talluto via use-livecode
Is there any reason to delete the stack? If not, don't. Clearly any CtoD should be investigated, but I have never seen why an app would be designed to create and delete stacks when all you have to do is show and hide existing ones.

Bob S


> On Feb 13, 2017, at 22:00 , Sannyasin Brahmanathaswami via use-livecode <[hidden email]> wrote:
>
>    This works if we just use "close stack oStackName"
>
>    but if I change this to "delete stack oStackName"


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
I frequently delete stacks when memory is an issue, which is the problem
with Swami's stack suite. I also create almost all new stacks with
destroystack set to true for the same reason.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com



On February 14, 2017 9:44:36 AM Bob Sneidar via use-livecode
<[hidden email]> wrote:

> Is there any reason to delete the stack? If not, don't. Clearly any CtoD
> should be investigated, but I have never seen why an app would be designed
> to create and delete stacks when all you have to do is show and hide
> existing ones.
>
> Bob S
>
>
>> On Feb 13, 2017, at 22:00 , Sannyasin Brahmanathaswami via use-livecode
>> <[hidden email]> wrote:
>>
>>    This works if we just use "close stack oStackName"
>>
>>    but if I change this to "delete stack oStackName"
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
BTW, we're not talking about creating and deleting new stacks on the fly,
we mean the "delete stack" command that removes an open stack from RAM.
--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com



On February 14, 2017 10:51:06 AM "J. Landman Gay via use-livecode"
<[hidden email]> wrote:

> I frequently delete stacks when memory is an issue, which is the problem
> with Swami's stack suite. I also create almost all new stacks with
> destroystack set to true for the same reason.
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
>
> On February 14, 2017 9:44:36 AM Bob Sneidar via use-livecode
> <[hidden email]> wrote:
>
>> Is there any reason to delete the stack? If not, don't. Clearly any CtoD
>> should be investigated, but I have never seen why an app would be designed
>> to create and delete stacks when all you have to do is show and hide
>> existing ones.
>>
>> Bob S
>>
>>
>>> On Feb 13, 2017, at 22:00 , Sannyasin Brahmanathaswami via use-livecode
>>> <[hidden email]> wrote:
>>>
>>>    This works if we just use "close stack oStackName"
>>>
>>>    but if I change this to "delete stack oStackName"
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
In reply to this post by Mark Talluto via use-livecode
J. Landman Gay wrote:

> My other project is crashing on Android the same way. It also has heavy
> server/internet use. I'm starting to think that's where the problem lies.

I wonder if that may be related to some of the leaks closed recently.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
On 2/14/17 3:38 PM, Richard Gaskin via use-livecode wrote:
> J. Landman Gay wrote:
>
>> My other project is crashing on Android the same way. It also has heavy
>> server/internet use. I'm starting to think that's where the problem lies.
>
> I wonder if that may be related to some of the leaks closed recently.
>

Would be nice, but it happens in 9.0dp4 too. :( My stack is in the QCC,
maybe they can figure it out. We have a repeatable recipe.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
In reply to this post by Mark Talluto via use-livecode
@ Jacque: I don't think it is ram after all.

FYI: on my Nexus 5 I have 1.8 GB RAM and our new app + All of Googles "widgets" that come preloaded take up a mere .8 GB and I have a full GB of RAM free. after proceeding (as we discussed off list with our team) to delete stacks when we move from one to another, so that only 1 or 2 are ever open in memory… I am pretty certain I'm not have a memory issue on this Android Device: but it still crashes.

I took this to HQ… I guess you all know about plugging in your android phone and running ./adb logcat  and then pass that over to LC support.

If you are interested  you can view it here:

http://wiki.hindu.org/uploads/siva-siva-app_adb-log.txt  # 13MB file

if you search

Activity Manager: Process com.himalayan

You will run into all the instances of

ActivityManager: Process com.himalayanacademy.sivasiva (pid 25473) has died

(crash/exit)


There appear to be three different "flavors" of "exited due to signal (11)  in that log.  I won't detail them here as I don't grok the log well enough to talk about it.

Hopefully HQ will figure it out… building from 8.1.3 (RC2)

does 9 dp4 change the file format? Safe?  I could make back ups of course.  and test… but need to keep moving on content dev…

 I have no recipe or rather, we do, but it seems harmless.

we "Go" from one stack to another, then after 10 milliseconds, delete the first one

here is the handler where the app exits on signal 11, you can  see where we were fiddling with

1) just closing it,
2) opening stack B and deleting stack A
3) Opening stack B and send a "Delete" stack A in 10 milliseconds.

All three scenarios cause android to crash and we have *lots* of open RAM.

command portal_GoStack stackName
   -- goes to the new stack
   -- closes the current stack
   -- safely ignores if we are alrady in the new stack
   
   put the short name of this stack into oStackName
   if oStackName = stackName then return oStackName
   
   go to stack stackName
  --close stack oStackName
   -- test deleting the stacks to save on RAM
  send "portal_RemoveStack oStackName" to me in 10 milliseconds  
--   delete stack oStackName
   return oStackName
end portal_GoStack

command portal_RemoveStack stackName
    if stackName <> "Siva-Siva-App" then
        delete stack stackName
    end if    
end portal_RemoveStack


# Works perfectly well on iOS








Svasti Astu, Be Well
Brahmanathaswami

www.himalayanacademy.com

 

On 2/14/17, 6:48 AM, "use-livecode on behalf of J. Landman Gay via use-livecode" <[hidden email] on behalf of [hidden email]> wrote:

    I frequently delete stacks when memory is an issue, which is the problem
    with Swami's stack suite. I also create almost all new stacks with
    destroystack set to true for the same reason.
   
   

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deleting stacks on the fly

Mark Talluto via use-livecode
Hi Brahmanathaswami,

What happens if you set the acceleratedRendering of the stack to false?

Best,
Panos
--

On Thu, Feb 16, 2017 at 9:08 PM, Sannyasin Brahmanathaswami via
use-livecode <[hidden email]> wrote:

> @ Jacque: I don't think it is ram after all.
>
> FYI: on my Nexus 5 I have 1.8 GB RAM and our new app + All of Googles
> "widgets" that come preloaded take up a mere .8 GB and I have a full GB of
> RAM free. after proceeding (as we discussed off list with our team) to
> delete stacks when we move from one to another, so that only 1 or 2 are
> ever open in memory… I am pretty certain I'm not have a memory issue on
> this Android Device: but it still crashes.
>
> I took this to HQ… I guess you all know about plugging in your android
> phone and running ./adb logcat  and then pass that over to LC support.
>
> If you are interested  you can view it here:
>
> http://wiki.hindu.org/uploads/siva-siva-app_adb-log.txt  # 13MB file
>
> if you search
>
> Activity Manager: Process com.himalayan
>
> You will run into all the instances of
>
> ActivityManager: Process com.himalayanacademy.sivasiva (pid 25473) has died
>
> (crash/exit)
>
>
> There appear to be three different "flavors" of "exited due to signal
> (11)  in that log.  I won't detail them here as I don't grok the log well
> enough to talk about it.
>
> Hopefully HQ will figure it out… building from 8.1.3 (RC2)
>
> does 9 dp4 change the file format? Safe?  I could make back ups of
> course.  and test… but need to keep moving on content dev…
>
>  I have no recipe or rather, we do, but it seems harmless.
>
> we "Go" from one stack to another, then after 10 milliseconds, delete the
> first one
>
> here is the handler where the app exits on signal 11, you can  see where
> we were fiddling with
>
> 1) just closing it,
> 2) opening stack B and deleting stack A
> 3) Opening stack B and send a "Delete" stack A in 10 milliseconds.
>
> All three scenarios cause android to crash and we have *lots* of open RAM.
>
> command portal_GoStack stackName
>    -- goes to the new stack
>    -- closes the current stack
>    -- safely ignores if we are alrady in the new stack
>
>    put the short name of this stack into oStackName
>    if oStackName = stackName then return oStackName
>
>    go to stack stackName
>   --close stack oStackName
>    -- test deleting the stacks to save on RAM
>   send "portal_RemoveStack oStackName" to me in 10 milliseconds
> --   delete stack oStackName
>    return oStackName
> end portal_GoStack
>
> command portal_RemoveStack stackName
>     if stackName <> "Siva-Siva-App" then
>         delete stack stackName
>     end if
> end portal_RemoveStack
>
>
> # Works perfectly well on iOS
>
>
>
>
>
>
>
>
> Svasti Astu, Be Well
> Brahmanathaswami
>
> www.himalayanacademy.com
>
>
>
> On 2/14/17, 6:48 AM, "use-livecode on behalf of J. Landman Gay via
> use-livecode" <[hidden email] on behalf of
> [hidden email]> wrote:
>
>     I frequently delete stacks when memory is an issue, which is the
> problem
>     with Swami's stack suite. I also create almost all new stacks with
>     destroystack set to true for the same reason.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...