Execution count
Moderator: Martin
Execution count
Hi,
I am facing some problem with execution count.
It dont work.
Actually i have made a flow which clear ram if it go below 200 mb. But sometimes it happen it goes on clearing ram many times repeatedily. So then i have used execution count but it didnt work.
What can be my mistake or is there any other way to do that??
I am facing some problem with execution count.
It dont work.
Actually i have made a flow which clear ram if it go below 200 mb. But sometimes it happen it goes on clearing ram many times repeatedily. So then i have used execution count but it didnt work.
What can be my mistake or is there any other way to do that??
Re: Execution count
Could you post your flow here so we'll see how you are using it?
Re: Execution count
Trigger: App Task Started: com.sec.android.app.launcher
Trigger: Display State: On
Action: Execute Command: cat /proc/meminfo
Action: Script: mem=split(stdout, "kB");memfree=getElement(mem, 1);memcached=getElement(mem, 3);memfree=substring(memfree, indexOf(memfree, ":")+1, length(memfree));memcached=substring(memcached, indexOf(memcached, ":")+1, length(memcached));global_free_ram="{(memfree+memcached)/1024,numberformat,0}";
Condition: Expression: global_free_ram <= 200 (true)
Condition: Execution Count: 2 times in 1m (false)
Action: Execute Command: am kill-all in
Trigger: Display State: On
Action: Execute Command: cat /proc/meminfo
Action: Script: mem=split(stdout, "kB");memfree=getElement(mem, 1);memcached=getElement(mem, 3);memfree=substring(memfree, indexOf(memfree, ":")+1, length(memfree));memcached=substring(memcached, indexOf(memcached, ":")+1, length(memcached));global_free_ram="{(memfree+memcached)/1024,numberformat,0}";
Condition: Expression: global_free_ram <= 200 (true)
Condition: Execution Count: 2 times in 1m (false)
Action: Execute Command: am kill-all in
Re: Execution count
Is there anything in the log of Automagic when this happens?
Maybe your device sends the Display State: On event many times.
What device/Android version are you using?
Maybe your device sends the Display State: On event many times.
What device/Android version are you using?
Re: Execution count
Hi martin
I am using samsung galaxy s duos android 4.0.4.
I am using samsung galaxy s duos android 4.0.4.
Last edited by Ankit on 14 Mar 2014 12:07, edited 1 time in total.
Re: Execution count
Hi,
Is it possible that you are using a loop in your flow? Could you please publish the flow (open the forum in Automagic, select button Publish Flows/Widgets at the bottom of the screen, select the flow, OK and then paste the generated link here)?
Using a loop seems to be a bit risky, maybe you should remove the loop completely since your phone might not be able to free enough RAM at all when a lot of foreground services or apps are running.
Regards,
Martin
Is it possible that you are using a loop in your flow? Could you please publish the flow (open the forum in Automagic, select button Publish Flows/Widgets at the bottom of the screen, select the flow, OK and then paste the generated link here)?
Using a loop seems to be a bit risky, maybe you should remove the loop completely since your phone might not be able to free enough RAM at all when a lot of foreground services or apps are running.
Regards,
Martin
Re: Execution count
Hi martin
I am not using any loop..
Actually i dont know about loop
http://automagic4android.com/flow.php?i ... 2f167f28bb
I am not using any loop..
Actually i dont know about loop

http://automagic4android.com/flow.php?i ... 2f167f28bb
Re: Execution count
Hi Ankit,
There's a connection from action Execute Command: am kill-all back to Execute Command: cat /proc/meminfo so the latter action will be executed twice in most cases. I would remove this connection and probably also the condition execution count.
If you want to reduce the number of times this flow is executed then you could disable the flow with an action Set Flow State: Disable Ram & Battery as one of the first actions of the flow and add an action Sleep: 1m as one of the last actions of the flow and also add an action Set Flow State: Enable Ram & Battery to enable the flow after one minute again.
Regards,
Martin
There's a connection from action Execute Command: am kill-all back to Execute Command: cat /proc/meminfo so the latter action will be executed twice in most cases. I would remove this connection and probably also the condition execution count.
If you want to reduce the number of times this flow is executed then you could disable the flow with an action Set Flow State: Disable Ram & Battery as one of the first actions of the flow and add an action Sleep: 1m as one of the last actions of the flow and also add an action Set Flow State: Enable Ram & Battery to enable the flow after one minute again.
Regards,
Martin
Re: Execution count
Hi martin
Actually i am using connection from action Execute Command: am kill-all back to Execute Command: cat /proc/meminfo because it dont immediately get updated in widget..
Without connection i have to click widget to see the updated ram and battery.....
But anyways u solved my problem..
Thanx martin.
Actually i am using connection from action Execute Command: am kill-all back to Execute Command: cat /proc/meminfo because it dont immediately get updated in widget..
Without connection i have to click widget to see the updated ram and battery.....
But anyways u solved my problem..
Thanx martin.