Android Oreo 8.1 - Need to increase swap space (increase total memory by allocating more of its storage)

mikhael
mikhael used Ask the Experts™
on
Hi all
I work for a OEM phone vendor. We have a prospective client that wants more RAM in a certain model Android Oreo 8.1 phone to prevent Android’s memory manager from closing the least recently used and RAM-hungriest apps. I propose to provide that by extending the swap partition (thus creating more swap memory) from the existing 0.5GB to 1.5 or better still 2.5GB. The storage is eMMC and there is enough storage (and fast storage) for what I want to do.
Most likely I need to change the partition structure and to do so I expect to have to root the phone. But I also need to be able to “unroot” the phone after. I cannot supply my client with rooted phones. But the other way to do it would be to somehow specify, a swap file (like Windows) on existing partitions. Is that possible? In this way, maybe root is not required? Don’t know.
Either way, additionally, I would like to do this from a command line in order to automate it – hopefully with an MDM/EMM; but that might be “dreaming”.
The volumes are not huge, and therefore, our overseas factory does not want to get involved.
Can anyone help me, please?
Cheers Mikhael
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Web Developer/Designer
Commented:
I found a pretty good walkthrough for adding a swap file to android.

https://www.droidviews.com/speed-up-android-devices-using-swap-part-1/

I haven't tried it myself but it looks pretty comprehensive. The downside is that you would need root, but the upside is that should only be for the initial setup. Your device's Android kernel will also need to support swap. There are options for doing this via command line or via third party app.
mikhaelSales Engineer

Author

Commented:
Thanks Brandon, I'll check it out
Jackie Man IT Manager
Top Expert 2010

Commented:
..by extending the swap partition (thus creating more swap memory) from the existing 0.5GB to 1.5 or better still 2.5GB.

Why you think that your phone has a swap partition of 0.5GB?

My SAMSUNG S7 Edge has a 2GB swap partition.

It is not a good idea for your rooting and unrooting approach.

The better approach is to specify the minimum and recommended requirements for memory (RAM)..

It is common to buy a phone with at least 3GB or 4GB memory these days.
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Brandon LyonWeb Developer/Designer

Commented:
It is common to buy a phone with at least 3GB or 4GB memory these days.

Depending on what you're doing that might not be enough. I find that 6GB is the minimum I need from an Android phone before it starts to close apps that I don't want it closing, and that's just from day to day usage. I had to ditch my Pixel 2 for that reason.
mikhaelSales Engineer

Author

Commented:
Sorry to take so long guys. I'm not ignoring you :)
I'm waiting for an "expendable" device to work on. Could be another week or so.
Cheers
Michael
Jackie Man IT Manager
Top Expert 2010

Commented:
Any progress?
mikhaelSales Engineer

Author

Commented:
Again sorry to take so long.
Brandon, I'm still waiting for an "expendable" unit to work on :(   Anyway, according to your referenced pages, it seems I can root, then "unroot" the phone. And separately, I am really keen to try zram and zswap as well.
Jackie Man, I know it is common to buy a phone with 3 or 4GB or more. And I wish I did have the ability to specify a larger memory (or storage either). However, this model only has the one spec.
I know it has 0.5GB swap currently because I am able to interrogate the phone with the ADB command from my PC (the command is free -h). See attached screenshot.
Hope this helps.
Stay tuned guys.
Cheers
Mikhael
ADB-screen-showing-0.5GB-swap-with-d.png
mikhaelSales Engineer

Author

Commented:
Guys thank you for your submissions. I have to close this question off. My belief is that being an "Android Enterprise Recommended" device, it has additional security mechanisms in place (e.g. ARM Trust Zone, SE Linux), and this prevents hackers like me from "rooting" the device.
Brandon your post was the most helpful. I am awarding you the points.
Cheers guys
Mikhael

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial