[ASK] How to reduce Application Memory Footprint? - Android Q&A, Help & Troubleshooting

Hi all,
I am a newbie @ Android application development, and still trying to learn. I have one question. If we take for example, the Greenify app, if i look into its memory consumption, the value is quite low (3.4MB +-) whereas, with my app, it always hover around 20MB or so. I wonder, how can i achieve the same result? Anybody can help? My application is a simple monitoring app for my client company, contains 2 services, 3 Activities (1 service and Activity for saving the account into the device). And even in fresh state, the memory always takes around 20MB.
Thanks for any info

Related

[Q] File expert memory manager - safe?

This is a pretty stupid question, but is File Expert's memory manager safe to use? I'm running CM9, the concept sounds great, I just want to be sure it can be easily reversed, etc. Thank you!
Sent from my GT-I9100 using xda app-developers app
Memory Manager (Pro; Root)
As of FE Pro V4.1.4, a new tool was added to FE. This requires the Pro plugin and root access on your device.
Every app that runs, Android puts into an "out of memory group" based on their priority; FOREGROUND_APP, VISIBLE_APP, SECONDARY_SERVER, HIDDEN_APP, CONTENT_PROVIDER, and EMPTY_APP.
When Android needs memory, it starts killing off applications in these groups based on how much memory is free; starting with the group with the highest value.
For example, if you set HIDDEN_APP = 24mb; when free memory on your device dips below 24mb, Android will kill off apps running in this group. If the next highest value was EMPTY_APP = 20mb, then Android will wait until free memory hits 20mb, then start killing off apps in THAT group - and so on.
You can control the behavior of Android's "task killer" by setting these values yourself using FE's Memory Manager. FE's team has come up with sets of values based on common behaviors of users. These "presets" can be used without any knowledge by the end user - just pick the one that suits you and you're done.
If you're a more advanced user, you may want to "dial in" these values yourself instead of using one of the pre-built settings. To do this, you'll need to understand each of the groups and what apps get put in there.
Foreground Application - An app that you currently see on the screen. (also includes System and Phone)
Visible Application - An app that is visible to the user but not at the front, possibly because of transparency, etc.
Secondary Server - These are BACKGROUND applications and services. This typically includes launchers (Launcher Pro, etc.) and UI shells (Sense, Motoblur, etc)
Hidden Application - Apps that are not visible but still run in the background.
Content Provider - Processes that provide for other apps (Contacts, Calendar, etc.)
Empty Application - Apps that are paused and not doing any work.
Source.
As for it being safe, I presume so because such a well known application "company" wouldn't put out risky stuff and the Chinese normally know what they are doing. That being said, I doubt it is needed. But give it a whirl and see for yourself
PS this should really be in the normal Android section somewhere rather than a device forum. Maybe get more opinions/views over there (the whole of xda has reason to go there, not just particular device) and perhaps worth pm'ing a mod to get this thread moved.
Good luck!

[Q] [JB] Power Saving Application of Multiple User Accounts

So I've been fooling around with JellyBean on my Nexus S 4g and am intrigued by the addition of multiple user accounts. I was curious if anyone thinks there could be some benefit to battery life if I were to switch into a user account specifically created to have little clutter? As in...
If I'm out hiking, and recognize that I don't need all these widgets/email notifications/twitter, could I switch into a "Streamlined" user account and extend my battery life?
Or, by switching users, am I simply doubling the processes which my phone has to handle?
I guess my question is simply this: when I switch users in JellyBean, does the primary user's applications still run in the background in addition to the guest? I hope I'm making sense! I frequently go to music festivals, and it would be awesome if I could use multiple user accounts to customize what I want my phone to be doing (to a greater extent than profiles allow).

Detailed Info or even Education about LMK and Virtual Memory

Hi fellas.
Long story short: I seek detailed information about how LMK and especially Virtual Memory works so I can educate myself for teletubbic purposes.
Details:
I'm my old, 1gb Samsung Galaxy S3 device I suffer quite a lot because of poor ram management. Slow insufficient memory for even 1 app ooorr app transitions(multitasking), laggy apps, out of memory reboots drains my will to live.
So time to time I searched internet (especially most of the XDA forums) to find a solution for this, for months(again, time to time). In this process I learned a LOT but unfortunately its not enough since I still haven't found what some virtual memory values and related build prop entries does. Some people made guides but it's not specific and explanatory enough, unfortunately. Just some basic info from surface.
There are a lot of apps and roms that claims to provide better ram management through different ways but as you might guess, none of them completely solved my problems.
Don't get me wrong. I know that at the and, it all comes down to my 1gb device. But through my whole Android experience, I know what this device is capable of. So.. Yeah.
I want specific amounts of apps to stay in memory.
I want my system to kill apps without a second thought in out if memory situations. Fast as if I use "force stop" button in Apps/Settings. (this is important, huh)
I want to set priority to apps about using memory according to app's needs and my use frequency.
To do all of that, instead of crying in forums, I want to educate myself about ram management and do my thing by myself by optimizing system to the end.
Any help, guides, links, courses, piece of info appreciated.
Thanks in advance

Development: Avoid Samsung Device Care Wakeup alarms

Hello,
We have an Android SDK that many applications use for marketing purposes. Specifically, it allows to deliver personalized messages to their users based on geofences or bluetooth beacons detection.
We've dedicated tons of hours optimizing the thing so it does not drain user battery or annoys in any matter, however we are now facing a new challenge: Samsung Device Care (Samsung Maintenance).
As you may know, this application comes pre installed in (I think) all Samsung devices, and helps users to keep the battery consumption low by detecting apps that consume too much in the background among other features.
Our software behaves correctly in almost all categories, including battery consumption and background time execution, however the Samsung device care app sometimes shows an alert saying that the "application generates too many wake ups". In order to avoid this, we are being more aggressive by explicitly controlling the number wake ups when app is in the background, the only problem is that we are completely blind right now, as we don't know what is the threshold that Samsung Device care app uses to trigger this alarm.
I have decompiled the Samsung device care app, however the app seems to be written in C / C++, hampering the task.
I have also run tests for days in a couple of Samsung phones in order to see if I can trigger the alarm, so I can try to empirically found what the limits are, however I haven't been able to trigger any alarm, even though my testing code is requesting an AlarmManager callback every 30 seconds.
Finally, I have also opened a ticket in the Samsung Developer site, but no answer so far...
Do you have any idea where can I find this information? :crying:

Bypass Background Processes Limit

Hello everybody
Search and search I could not find a solution for this I ask the forum for help: generally you want to limit the background processes to limit battery use blah blah blah and various things ... and generally this limit is around 20 applications (at least to myself)
Let's assume I want to get around this limit with Android 7 or higher. That is, I don't care about battery consumption or keeping the Ram free, but I need to have n processes running in the background
In this case how could I get around or eliminate the maximum number? From developer settings i can only choose a lower number and with an Android up to 4 you can use the command line "SERVICE CALL ACTIVITY 51 i32 x" where x is the maximum number of processes
But with the latest Android?
Thanks to those who want to dedicate time to me
@Neofita00
Take note that the Android low memory killer daemon (lmkd) process monitors the memory state of a running Android system and reacts to high memory pressure by killing the least essential processes to keep the system performing at acceptable levels.
More info here.
Thank you very much for your fast feedback... In my situation (emulating android on a pc) I don't have a saturable limit under standard conditions
So in your opinion, is it possible to bypass the system restriction?

Categories

Resources