maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   ProfileMatic & Drop Cache = Infinite memory!! (https://talk.maemo.org/showthread.php?t=85381)

weedm8 2012-07-10 05:25

ProfileMatic & Drop Cache = Infinite memory!!
 
Hi guys!

I has an IDEA!

ProfileMatic comes with the "Custom action" -thingy which is nearly no use for me with my skills, but could we implement a script there which runs Drop Cache's "Free all"?
I don't know much of any scripting nor coding, but this could be a fantastic improvement. Free memory when ever you want, automatically.

Anyone?



Step-by-step guide:

1. Install Drop Cache & ProfileMatic
2. Fire up the ProfileMatic
3. Create a profile like:

Time:
Starts: 06:00
Ends: 06:01
Every day!!
Custom Action:
Custom action on rule activate:
Code:

aegis-exec /opt/dropcache-mdn/bin/dropcache.sh --3
4. Save
5. Enable rules in ProfileMatics settings.
6. Tsadamn! You've made a script which will clear your cache and free memory at 06:00 every day.


Good luck! It shouldn't be hard.

WARNING: This has not yet been tested enough. Report any problems like battery drain, sluggish phone, applications errors etc. to this thread!!!

I have been using this for 4 months without any noticeable battery drain, sluggishness, phone warming up.. Nothing at all. This trick seems cool to me. Just make it do the "refresh" by night time or when you usually charge your phone, just to make sure you don't get any surprising battery drain during your work-day.

Muzimak 2012-07-10 06:40

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
Wow man that could be awesome, been wondering how this could work.

ajalkane 2012-07-10 06:52

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
This should work... First of course install DropCache. Then add one of the following to ProfileMatic's Custom action.

Free pagecache:
Code:

sh /opt/dropcache-mdn/bin/dropcache.sh --1
Free dentries and inodes:
Code:

sh /opt/dropcache-mdn/bin/dropcache.sh --2
Free pagescache, dentries and inodes:
Code:

sh /opt/dropcache-mdn/bin/dropcache.sh --3

reinob 2012-07-10 07:00

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
and what effect might this bring?

if the kernel needs memory it will free whatever memory can be freed (normally the cache). If not, what's the point of freeing the caches? your N9 will have to reload stuff again -> slower + more battery consumption.

please leave the kernel alone!

weedm8 2012-07-10 08:26

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
Quote:

Originally Posted by reinob (Post 1235002)
and what effect might this bring?

if the kernel needs memory it will free whatever memory can be freed (normally the cache). If not, what's the point of freeing the caches? your N9 will have to reload stuff again -> slower + more battery consumption.

please leave the kernel alone!


The benefit I'm looking here would be that the N9 really feels sluggish from time to time. Let's say that 1 minute would suck alot, BUT how about a free memory every 3-24h example.

Same point that the Drop Cache would do, but an automated system that you don't need to bother click click clickety clicking it from time to time to make your N9 run smoother. I'd say it wouldn't be a noticeable battery drain, If used with caution.

Of course, I'm not an expert and this is just my opinion on this. Feel free to explain and give your own opinions. We really need them!!

I'm still wondering does this cause some complications to apps like Wazapp which runs on background and is "idle" nearly 100% of the time? Will they crash / stop while freeing cache? Or does the Drop Cache just affect the cache that is NOT in use by any running application?

all00 2012-07-10 08:47

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
Quote:

Originally Posted by ajalkane (Post 1234998)
This should work... First of course install DropCache. Then add one of the following to ProfileMatic's Custom action.

Free pagecache:
Code:

sh /opt/dropcache-mdn/bin/dropcache.sh --1
Free dentries and inodes:
Code:

sh /opt/dropcache-mdn/bin/dropcache.sh --2
Free pagescache, dentries and inodes:
Code:

sh /opt/dropcache-mdn/bin/dropcache.sh --3

I tested the command in terminal:

sh /opt/dropcache-mdn/bin/dropcache.sh --2
/opt/dropcache-mdn/bin/dropcache.sh: line36: can't create /proc/sys/vm/drop_caches: permission denied

weedm8 2012-07-10 08:48

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
Quote:

Originally Posted by all00 (Post 1235087)
I tested the command in terminal:

sh /opt/dropcache-mdn/bin/dropcache.sh --2
/opt/dropcache-mdn/bin/dropcache.sh: line36: can't create /proc/sys/vm/drop_caches: permission denied

Mmmm... Fix this, then I'm gonna give it a try.

This seems to work in terminal with root access.

This is what I got:

Code:

$ devel-su
Password:


BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) buil
t-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # sh /opt/dropcache-mdn/bin/dropcache.sh --3
~ #


vi_ 2012-07-10 08:53

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
...Why don't you just change your VM settings if you do not want any VFS cache?

Also, memory does not work that way.

weedm8 2012-07-10 09:01

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
Quote:

Originally Posted by vi_ (Post 1235096)
...Why don't you just change your VM settings if you do not want any VFS cache?

Also, memory does not work that way.

Because I don't know how to, tell me please.
I'm looking for something like fast "re-boot" here mate.

ajalkane 2012-07-10 09:03

Re: ProfileMatic & Drop Cache = Infinite memory!!
 
Quote:

Originally Posted by all00 (Post 1235087)
I tested the command in terminal:

sh /opt/dropcache-mdn/bin/dropcache.sh --2
/opt/dropcache-mdn/bin/dropcache.sh: line36: can't create /proc/sys/vm/drop_caches: permission denied

Hmm... seems like running as root is required. We're getting into the murky waters of aegis land now. You can try:

Code:

aegis-exec /opt/dropcache-mdn/bin/dropcache.sh --3


All times are GMT. The time now is 18:12.

vBulletin® Version 3.8.8