Execution count

Post your questions and help other users.

Moderator: Martin

Post Reply
Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Execution count

Post by Ankit » 12 Mar 2014 05:38

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??

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Execution count

Post by MURTUMA » 12 Mar 2014 06:58

Could you post your flow here so we'll see how you are using it?

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: Execution count

Post by Ankit » 12 Mar 2014 12:13

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

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: Execution count

Post by Ankit » 13 Mar 2014 10:57

Hey anyone tried ??

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Execution count

Post by Martin » 13 Mar 2014 17:09

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?

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: Execution count

Post by Ankit » 14 Mar 2014 02:34

Hi martin

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.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Execution count

Post by Martin » 14 Mar 2014 10:00

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

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: Execution count

Post by Ankit » 14 Mar 2014 11:59

Hi martin

I am not using any loop..
Actually i dont know about loop :-)


http://automagic4android.com/flow.php?i ... 2f167f28bb

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Execution count

Post by Martin » 14 Mar 2014 13:09

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

Ankit
Posts: 143
Joined: 11 Nov 2013 17:27

Re: Execution count

Post by Ankit » 14 Mar 2014 13:48

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.

Post Reply