• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[CLARIFICATION] Xperia Lollipop & "Fix Lollipop Memory Leak"

Search This thread

IgorEisberg

Senior Member
Jul 6, 2009
1,758
3,799
www.audiobudget.com
Hey there, the XperiFirm dev here.

I've seen people that use the official Lollipop on their Xperia devices, yet they also use the "Fix Lollipop Memory Leak" Xposed module.
Let's make something clear: Xperia Lollipop does NOT have that memory leak.
Sony made sure to include the memory leak fix built in (the exact fix that the Xposed module offers) for their Lollipop releases. The Xposed module is pointless.
Basically the Xposed module replaces the AOSP function with exactly the same function but with this additional "release()" line. As you can see in the attached screenshot, Xperia already has this line included.

Hope that stops you from using the highly unstable alpha of Xposed Framework for a module that is totally useless for your Xperia device.

services.jar
smali/com/android/server/display/ColorFade.smali
Line 318
 

Attachments

  • Untitled.png
    Untitled.png
    92.6 KB · Views: 10,137
Last edited:

IgorEisberg

Senior Member
Jul 6, 2009
1,758
3,799
www.audiobudget.com
See thats why Sony dont rushed with Lollipop :D
Good thing they didn't, I am very satisfied with Lollipop on my Z1, it's smooth, I get 700-800 free RAM, and absolutely NO lag...
thats why i never use xposed modules...it can be unstable and lower ur perfomance of the phone. ;)
... and that's when the picture changes: when I use Xposed (on a properly deodexed and highly stable ROM I made myself) my phones lags awfully, it heats up quickly, and the battery gets drained in a few hours. (no bootloops though)
I'd skip Xposed until the stable version gets released.
 
  • Like
Reactions: vanbroekhoven.wim

Pandemic

Senior Member
Aug 30, 2010
24,002
23,177
Meppel
talk.sonymobile.com
Good thing they didn't, I am very satisfied with Lollipop on my Z1, it's smooth, I get 700-800 free RAM, and absolutely NO lag...

... and that's when the picture changes: when I use Xposed (on a properly deodexed and highly stable ROM I made myself) my phones lags awfully, it heats up quickly, and the battery gets drained in a few hours. (no bootloops though)
I'd skip Xposed until the stable version gets released.

+1
exactly, it runs very smooth, fluid and fast on my Z2 either :D
No lag at all ^^
 

_mysiak_

Senior Member
Apr 1, 2009
2,422
1,410
Xiaomi Mi 10T Lite
Thanks for the explanation, I was wondering about the same. Although I do not agree that Xposed is highly unstable. It doesn't cause any lags, battery drain or any instability to my phone (odexed Z2 .726). Usability of Xposed for LP is close to KK experience.
 

mionica

Senior Member
Jul 24, 2008
258
454
Dublin
EDIT #2: I've found the root cause of the problem: see here.

Hey there, the XperiFirm dev here.

I've seen people that use the official Lollipop on their Xperia devices, yet they also use the "Fix Lollipop Memory Leak" Xposed module.
Let's make something clear: Xperia Lollipop does NOT have a memory leak.
Sony made sure to include the memory leak fix built in (the exact fix that the Xposed module offers) for their Lollipop releases. The Xposed module is pointless.
Basically the Xposed module replaces the AOSP function with exactly the same function but with this additional "release()" line. As you can see in the attached screenshot, Xperia already has this line included.

Hope that stops you from using the highly unstable alpha of Xposed Framework for a module that is totally useless for your Xperia device.
EDIT: please just ignore the rest of the post, I misunderstood the Fix Lollipop Memory Leak bit.


The purpose of xposed-sonyfix is not to fix a memory leak, but to prevent bootloops on the 2nd and subsequent boots with the framework installed. I have no idea whether that's still required with xposed-sdk21-arm-20150426.zip, but it was sure as hell a problem with xposed-arm-20150308.zip.

With stock Z3 LP firmware and xposed-arm-20150308.zip - even without the xposed apk! - one needed to wipe /cache before every boot, and wait until all the apps were compiled again. Not too convenient.
@ondrejvaroscak discovered that if the open file limits were increased during boot, the bootloop didn't happen anymore; and another dude did a .zip (actually 3 :p) that increased the file limits on boot.
At that stage, I stepped in, with the goal to provide a complete solution that would 1) get rid of the bootloop, and 2) when boot had finished, attempt to restore the on-init default values to zygote's process tree.

All the discussion about leaks is pure speculation. Here I summarized that - the relevant bits are
And there's one more thing. We like to blame Xposed (or at least you seem to :) ), but we don't have a clue whether it's Xposed or Android itself. This just occured to me - they recently released 5.1.1, which reportedly fixed some memory leaks that have been in since 5.0.0 - I wonder if memory's all that 5.0.2's leaking... What about handles? What if Xposed LP only works on other platforms because the kernel devels of those devices had figured **** might hit the fan, so they increased the kernel limits to accomodate a leaky Android?... What if Sony's stock app_process does some crazy Sony-specific things to avoid said leaks, or clean up after them, which Xposed's doesn't?... That wouldn't break SU, which only hooks the file entry, but would break Xposed, which replaces app_process altogether...
and
...and yeah, that's obviously the thing to do. If we talk to the Xposed devs and say, "it doesn't work on our device", I think a "so what?" answer would be actually appropriate. That's why I haven't approached them do date; when I do, I mean to be able to say, "this is what seems to be wrong, this is my analysis, here are my logs; can I help you (help me :D) in any other way?"

That said, bootloops are a fact with stock LP firmware, on the stock kernel, and xposed-arm-20150308.zip. I'm actually cleaning the phone ATM in order to have a clean testbed for checking whether xposed-sdk21-arm-20150426.zip is different in this respect.

This is not a blame game. It's sound engineering on my behalf, attempting to fix an observed, and rather inconvenient, problem - which yes, is either caused by, or triggered by, running Xposed Framework (binary version 20150308), on Sony LP devices with a lot of .apk's installed - I expect if either one of these 3 conditions isn't met, the problem doesn't occur. It can't be observed, for instance, on debloated ROMs.
 
Last edited:

mo120697

Senior Member
Sep 17, 2014
466
244
Ludwigsburg
Hey there, the XperiFirm dev here.

I've seen people that use the official Lollipop on their Xperia devices, yet they also use the "Fix Lollipop Memory Leak" Xposed module.
Let's make something clear: Xperia Lollipop does NOT have a memory leak.
Sony made sure to include the memory leak fix built in (the exact fix that the Xposed module offers) for their Lollipop releases. The Xposed module is pointless.
Basically the Xposed module replaces the AOSP function with exactly the same function but with this additional "release()" line. As you can see in the attached screenshot, Xperia already has this line included.

Hope that stops you from using the highly unstable alpha of Xposed Framework for a module that is totally useless for your Xperia device.
nice to hear, but tell my why xperia home gets reloaded sometimes after browsing etc. and why gets music, spotify kicked out?
 

omike123

Senior Member
Aug 21, 2014
77
21
how about xperia c3

My device xperia c3 also get lollipop from Sony. Now I am wondering if this so called 'memory leak fix' is also included in the update?
 

Henrald

Member
Apr 5, 2015
16
4
I don't know... this is off-topic.

It's not, I have the issue too. Podcast apps - Pocket Casts, Stitcher AND BeyondPod - all constantly crash while running in the background, and stop playing, since I've upgraded to lollipop. I'm certain it's down to the memory getting full. I've been Googling around for days and uninstalling apps but nothing had made a dent, so far. Rebooting the phone frees up more than half the memory, but it gets taken up again in a few minutes.

I never had this problem with KitKat on my Z1 Compact. If it's not a memory leak, what is it?

NB I have also encrypted my device for the first time. I thought this would use more cpu or slow disk access, but I don't see why it would affect the RAM... right?
 

IgorEisberg

Senior Member
Jul 6, 2009
1,758
3,799
www.audiobudget.com
It's not, I have the issue too. Podcast apps - Pocket Casts, Stitcher AND BeyondPod - all constantly crash while running in the background, and stop playing, since I've upgraded to lollipop. I'm certain it's down to the memory getting full. I've been Googling around for days and uninstalling apps but nothing had made a dent, so far. Rebooting the phone frees up more than half the memory, but it gets taken up again in a few minutes.

I never had this problem with KitKat on my Z1 Compact. If it's not a memory leak, what is it?

NB I have also encrypted my device for the first time. I thought this would use more cpu or slow disk access, but I don't see why it would affect the RAM... right?
I don't have any app crashes here. Don't know what to tell you. I usually have 700-900 MB of free RAM. On rare occasions it even gets to 1GB of free RAM.
That's probably because my ROM is very clean. Those issues you have might happen because one of your stock or installed apps having a memory leak and force Android to kill tasks to keep your phone up and running.
 

xXFlippyXx

Senior Member
May 17, 2012
154
39
Had those same annoying problems. On device start I've got about 1gb of free ram.I don't have much apps installed and I'm cleaning apps I no longer need once per week
Atm I've got about 25 (extra) apps installed with much stuff removed from stock Sony (most google Apps, xperia share stuff)

So far the basis:
As soon as my device is on for about a day I'm having launcher redraws as soon As I'm closing chrome. ChRome is (aside from games) my biggest ram consumer. when opening tabs it gets even worse. Walkman stops playing, SmartBand gets disconnected, games are resetting. Then I need to clear my recent apps, and restart the device.

Now the crux: This happens whether or not there is xposed installed on my device.

Now, you might say that this xposed module is obsolete, but don't say that Sony has fixed the memory leaks by themselves.

Aside From this particular problem I'm happy with lp for xperia

Sony did an awesome job, even more when compared to other manufactures

My device: z1 c6903, 5.0.2 pre rooted with xposed installed.

Quintessential:

Big ram eater=launcher redraw.

As if I'm running an up2date chrome on my Xperia s or arc s. A shame for a device with whooping 2gb ram
 

hansip87

Senior Member
Jan 14, 2011
2,915
2,242
Jakarta
That's a relief :) But still, Lollipop likes to kill app in background. Even one with visible Component in Notification. Yesterday i record an audio with Sony's app and then switch to reading app. but when i switch back to the audio recording app, it stops after some 30s+ in background. That's too much imho so i think Google's the one to blame for Lollipop issues.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 76
    Hey there, the XperiFirm dev here.

    I've seen people that use the official Lollipop on their Xperia devices, yet they also use the "Fix Lollipop Memory Leak" Xposed module.
    Let's make something clear: Xperia Lollipop does NOT have that memory leak.
    Sony made sure to include the memory leak fix built in (the exact fix that the Xposed module offers) for their Lollipop releases. The Xposed module is pointless.
    Basically the Xposed module replaces the AOSP function with exactly the same function but with this additional "release()" line. As you can see in the attached screenshot, Xperia already has this line included.

    Hope that stops you from using the highly unstable alpha of Xposed Framework for a module that is totally useless for your Xperia device.

    services.jar
    smali/com/android/server/display/ColorFade.smali
    Line 318
    3
    EDIT #2: I've found the root cause of the problem: see here.

    Hey there, the XperiFirm dev here.

    I've seen people that use the official Lollipop on their Xperia devices, yet they also use the "Fix Lollipop Memory Leak" Xposed module.
    Let's make something clear: Xperia Lollipop does NOT have a memory leak.
    Sony made sure to include the memory leak fix built in (the exact fix that the Xposed module offers) for their Lollipop releases. The Xposed module is pointless.
    Basically the Xposed module replaces the AOSP function with exactly the same function but with this additional "release()" line. As you can see in the attached screenshot, Xperia already has this line included.

    Hope that stops you from using the highly unstable alpha of Xposed Framework for a module that is totally useless for your Xperia device.
    EDIT: please just ignore the rest of the post, I misunderstood the Fix Lollipop Memory Leak bit.


    The purpose of xposed-sonyfix is not to fix a memory leak, but to prevent bootloops on the 2nd and subsequent boots with the framework installed. I have no idea whether that's still required with xposed-sdk21-arm-20150426.zip, but it was sure as hell a problem with xposed-arm-20150308.zip.

    With stock Z3 LP firmware and xposed-arm-20150308.zip - even without the xposed apk! - one needed to wipe /cache before every boot, and wait until all the apps were compiled again. Not too convenient.
    @ondrejvaroscak discovered that if the open file limits were increased during boot, the bootloop didn't happen anymore; and another dude did a .zip (actually 3 :p) that increased the file limits on boot.
    At that stage, I stepped in, with the goal to provide a complete solution that would 1) get rid of the bootloop, and 2) when boot had finished, attempt to restore the on-init default values to zygote's process tree.

    All the discussion about leaks is pure speculation. Here I summarized that - the relevant bits are
    And there's one more thing. We like to blame Xposed (or at least you seem to :) ), but we don't have a clue whether it's Xposed or Android itself. This just occured to me - they recently released 5.1.1, which reportedly fixed some memory leaks that have been in since 5.0.0 - I wonder if memory's all that 5.0.2's leaking... What about handles? What if Xposed LP only works on other platforms because the kernel devels of those devices had figured **** might hit the fan, so they increased the kernel limits to accomodate a leaky Android?... What if Sony's stock app_process does some crazy Sony-specific things to avoid said leaks, or clean up after them, which Xposed's doesn't?... That wouldn't break SU, which only hooks the file entry, but would break Xposed, which replaces app_process altogether...
    and
    ...and yeah, that's obviously the thing to do. If we talk to the Xposed devs and say, "it doesn't work on our device", I think a "so what?" answer would be actually appropriate. That's why I haven't approached them do date; when I do, I mean to be able to say, "this is what seems to be wrong, this is my analysis, here are my logs; can I help you (help me :D) in any other way?"

    That said, bootloops are a fact with stock LP firmware, on the stock kernel, and xposed-arm-20150308.zip. I'm actually cleaning the phone ATM in order to have a clean testbed for checking whether xposed-sdk21-arm-20150426.zip is different in this respect.

    This is not a blame game. It's sound engineering on my behalf, attempting to fix an observed, and rather inconvenient, problem - which yes, is either caused by, or triggered by, running Xposed Framework (binary version 20150308), on Sony LP devices with a lot of .apk's installed - I expect if either one of these 3 conditions isn't met, the problem doesn't occur. It can't be observed, for instance, on debloated ROMs.
    2
    See thats why Sony dont rushed with Lollipop :D
    2
    I'm the developer of said Xposed module and just stumbled across this thread.
    Thank you very much for the investigation, the highlighted smali line indeed confirms that the module isn't needed at all on Sony stock devices.
    Kudos to Sony to not just blindly follow Googles misguided lead.

    I updated my thread with the info that it isn't needed for Sony stock devices and linked to this thread.

    Cheers.
    1
    Had those same annoying problems. On device start I've got about 1gb of free ram.I don't have much apps installed and I'm cleaning apps I no longer need once per week
    Atm I've got about 25 (extra) apps installed with much stuff removed from stock Sony (most google Apps, xperia share stuff)

    So far the basis:
    As soon as my device is on for about a day I'm having launcher redraws as soon As I'm closing chrome. ChRome is (aside from games) my biggest ram consumer. when opening tabs it gets even worse. Walkman stops playing, SmartBand gets disconnected, games are resetting. Then I need to clear my recent apps, and restart the device.

    Now the crux: This happens whether or not there is xposed installed on my device.

    Now, you might say that this xposed module is obsolete, but don't say that Sony has fixed the memory leaks by themselves.

    Aside From this particular problem I'm happy with lp for xperia

    Sony did an awesome job, even more when compared to other manufactures

    My device: z1 c6903, 5.0.2 pre rooted with xposed installed.

    Quintessential:

    Big ram eater=launcher redraw.

    As if I'm running an up2date chrome on my Xperia s or arc s. A shame for a device with whooping 2gb ram

    I have a whole lot of extra apps installed + flashed. but i have not experienced any redraw.
    z1 lp .242 prerooted but no xposed.
    I spent a week without restarting my phone recently.