Why are zram and swap hogging my RAM? - G4 Q&A, Help & Troubleshooting

Lately my G4 has suddenly locked up several times, usually when unlocking. Everything would slow to a crawl (several minutes for anything to respond) or freeze entirely until I rebooted (which sometimes required pulling the battery).
I installed Cool Tool to diagnose the problem and found that it happens when free RAM gets under about 180MB. kswapd kicks in with several hundred MB/s of I/O (I saw it over 1000 once). I'm not sure what it's doing with that much I/O, but of course it makes everything grind to a screeching halt.
Looking in Kernel Adiutor (sic), ZRAM is set to 700MB and swappiness (who puts swap on a flash storage device anyway?) is 80. Both seem very high to me. Why using 700MB of precious RAM food for a virtual, compressed (slow!) swap file, and swap so often? I adjusted them to. 250MB and 20 respectively. As expected I now have way more free RAM (average ~600MB, up from ~300), things seem more responsive and I haven't had any lockup (but I only did this a few hours ago, so too early to know if it really fixed the problem).
Anyone know why these were set to such large numbers? Anyone else have this issue and if so, does this tweak help?

Mine was 40 in swappiness but zram value stick to 700mb

That's odd. I wonder if some process adjusts it on the fly when RAM is low?

Just had another "freeze" with ~200MB free. Again kswapd doing a bunch of I/O and slowing everything else down. Wasn't nearly as bad this time though. Less I/O going on, things were sluggish but not completely frozen, was able to open the recent apps menu and hit Clear All to free up a ton of memory and get things running smoothly again. Maybe need to tweak OOM killer and swappiness settings more so I don't have dozens of old aops/tabs hanging around hogging memory.

RenaKunisaki said:
Just had another "freeze" with ~200MB free. Again kswapd doing a bunch of I/O and slowing everything else down. Wasn't nearly as bad this time though. Less I/O going on, things were sluggish but not completely frozen, was able to open the recent apps menu and hit Clear All to free up a ton of memory and get things running smoothly again. Maybe need to tweak OOM killer and swappiness settings more so I don't have dozens of old aops/tabs hanging around hogging memory.
Click to expand...
Click to collapse
are we both the odd bunch? this is the first time I've come across someone else experiencing the same issues as me! switched from a Samsung to an LG, 3GB to 4GB device respectively, and still experiencing this from time to time.

Related

GPS Sensor/Apps cause phone to crash/reboot

Hello good people of XDA, I am having a bit of an annoying issue with my Cyanogenmod 7.1 "stable" install on my Evo 4G. Tiamat 4.1.0 SBC+ Kernel.
When I run a gps related application like Ulysse speedometer, Google Maps and Navigation, after a seemingly random amount of time the phone crashes and reboots itself. The time that I can use the app may be a few seconds to a few minutes and I havent noticed anything that would help determine the timing issue.
I have been doing a little testing and while running logcat on my PC via ADB, I have pulled the last events that occur immediately before the crash. It seems to me that the issue is more/only likely to occur when the phone is also not connected to a wifi network. Everything works fine when using GPS while connected over wifi.
Is anybody interested in reading through the end of my log file? How should I post it?
Please, any help at all?
sntmods said:
Please, any help at all?
Click to expand...
Click to collapse
I've been having the same problem as you and I think I've figured out a fix for it. I'm on Deck's 1.3 stable (which is essentially CM7.1) with Tiamat 4.1.0 SBC, using the smartass governor (the original one) with a CPU frequency range from 128 MHz to 768 MHz, and undervolted by 100 mV.
I've only encountered the issue sporadically and it's only occurred when using Google Maps or Navigation. I would be using Maps and moving the map around a lot, rotating it, or zooming in and out and all of a sudden the screen would freeze and the phone would reboot after 10 seconds or so. I figured out that I could reproduce the problem by opening up a bunch of apps to get the free memory (RAM) down to about 100 MB, open up Google Music and start streaming a song on the handset speaker, then open up Maps and just move around the map a lot; after less than a minute of doing this, the screen would freeze and the phone would reboot.
I tried uninstalling and reinstalling Maps; wiping the cache, dalvik cache, and fixing permissions; reverting to an older version of Maps (5.10); reversing the undervolting; changing governors; and changing the CPU frequency range; but none of these things fixed the problem.
I noticed that if I tried the Music and Maps crash technique when there was more free RAM (say 150 - 250 MB free), it wouldn't work, so I figured the problem probably had to do with the apps in use not having enough available RAM to operate properly and the default values that Android uses to kill idle apps was set too low. Fortunately, I remembered about Autokiller Memory Optimizer, which allows you to set those values, so that you always have above a certain level of free RAM. First, I tried the “Aggressive” preset (82, 90, 98), which didn’t fix the problem, so I then tried the “Extreme” preset (150, 160, 170) and that fixed it (for a full explanation of what the numbers mean and how the app works, see the Autokiller Memory Optimizer). I tried several different combinations of values between the Aggressive and Extreme presets and finally settled on Hidden app: 110, Content provider: 120, Empty app: 130. I was able to use lower values and still prevent the crash/reboot issue, but I figured I should leave a little buffer room to be safe and the 110, 120, 130 combo seemed low enough to prevent idle apps from being unnecessarily killed.
So, I’m not exactly sure what the root cause of the problem is, but Autokiller Memory Optimizer seems to be a nice workaround to fix the problem.
Well after testing this workaround for some time now, I can say that it doesn't prevent the reboots completely, but it does seem to have decreased their frequency, such that it's only happened one or two times since I started using it. I tried changing the cutoff values for when certain types of apps are killed, but eventually returned to the original levels I went with (Hidden app: 110, Content provider: 120, Empty app: 130) as they seemed to work the best (the one or two reboots that did happened, occurred when I was experimenting with the values).

Dungeon Defenders

Not only killed my battery while downloading the needed DLC.
On top of that, my phone was boiling to the touch! And, after all that hassle.....the game lags! Didn't expect bad performance at all
Alright, just to add...
For some ODD reason, the CPU usage on this phone spikes HARD It's usually bouncing around 40-70%, that would explain the stutter in some games. Now to figure out how to fix this problem...
bmxant said:
Not only killed my battery while downloading the needed DLC.
On top of that, my phone was boiling to the touch! And, after all that hassle.....the game lags! Didn't expect bad performance at all
Click to expand...
Click to collapse
I've noticed that this phone stutters randomly when switching from app to app sometimes. I notice it happen when I am playing music via Poweramp, and then switch to maps, n when it loads the map, the song stutters hardly. I dont mean it skips a beat or something, it actually breaks the song and make it sound mechanical for a second before resuming the song properly.
Now I don't know if it's the phone itself, an app installed (maybe ram manager?) or just the lack of available Ram on the phone that is causing this, but it's sad and worrying to see a dual core 1.5Ghz cpu stutter under a light load switch. Anybody notice that the free Ram left on this phone is generally alarmingly low, around 130MB left out of 783MB? What is eating up so much Ram on this phone? When I was on the Atrix, I generally still have 300-400MB left free to be used (I dont recall whether it actually has the full 1000MB available or also 783MB though) and I never experience stuttering.
Is this resolution really tasking the CPU? or is it because it has to render these apps to fit properly in the 720P resolution?
p.s. Another game that lags: Jelly Defense, when you have a lot of enemies flowing down the path, it starts getting choppy.
As I mentioned, I'm pretty sure it's the CPU spikes doing it. I have around 400mb free of ram also. I know Dungeon Defenders lags on the Galaxy Nexus as well, but I'm pretty sure it doesn't have as many problems. Then again, it was built on ICS
Grab Memory Booster Lite and you can monitor how much RAM is being used as well as the CPU % for each task
Is Dungeon Defenders working for everyone else? I can run it for about 30 seconds and then it just closes. No force close message or anything, it just freezes for a second or two and then disappears.
aquariuz23 said:
Anybody notice that the free Ram left on this phone is generally alarmingly low, around 130MB left out of 783MB?
Click to expand...
Click to collapse
after a thorough freezing, go launcher shows me at ~580M free on a fresh reboot and usually running low 500M free mem at any time, running 510M free right this second. this is with RAM manager, which by my estimates accounts for 5% in that #
scott0 said:
after a thorough freezing, go launcher shows me at ~580M free on a fresh reboot and usually running low 500M free mem at any time, running 510M free right this second. this is with RAM manager, which by my estimates accounts for 5% in that #
Click to expand...
Click to collapse
Do you experience any lags on Dungeon Defenders (if you have it)? Or do some of your games stutter like bmxant's?

[Q] RAM Usage

I've been noticing some slight lag in unlocking, the screen coming on, etc on my new Note 4 from time to time. I've found that going in the app switcher thing and clearing all remedies the issue for a bit.
I was curious recently and looked at the RAM usage in that screen and was surprised to see that ~2.1GB of RAM was being used, even after clearing all recent apps.
Is it normal for the thing to be using over 2GB of RAM at all times? This seems very strange to me.
Thoughts?
rmp5s said:
I've been noticing some slight lag in unlocking, the screen coming on, etc on my new Note 4 from time to time. I've found that going in the app switcher thing and clearing all remedies the issue for a bit.
I was curious recently and looked at the RAM usage in that screen and was surprised to see that ~2.1GB of RAM was being used, even after clearing all recent apps.
Is it normal for the thing to be using over 2GB of RAM at all times? This seems very strange to me.
Thoughts?
Click to expand...
Click to collapse
I'm pretty sure its normal because mine is also using 2GB after clearing all. After a reboot, it dropped to 1.6GB before manually launching any application. I'm pretty sure Android is designed this way.
The way android is made and runs, it uses almost all RAM at all times... Basically "unused RAM is wasted RAM." All of our phones have run this way since the time of I'm.
Now, with respect to lag, that's all the bloatware forcing itself to be the main process or close to it. Only way is to fully delete (not only disable) all of them and their underlying processes.
Sent from my SAMSUNG-SM-N910A
greekunit690 said:
The way android is made and runs, it uses almost all RAM at all times... Basically "unused RAM is wasted RAM." All of our phones have run this way since the time of I'm.
Now, with respect to lag, that's all the bloatware forcing itself to be the main process or close to it. Only way is to fully delete (not only disable) all of them and their underlying processes.
Sent from my SAMSUNG-SM-N910A
Click to expand...
Click to collapse
Thanks for the replies, guys. Just waiting on root, then bloatware will be gone.
greekunit690 said:
The way android is made and runs, it uses almost all RAM at all times... Basically "unused RAM is wasted RAM." All of our phones have run this way since the time of I'm.
Now, with respect to lag, that's all the bloatware forcing itself to be the main process or close to it. Only way is to fully delete (not only disable) all of them and their underlying processes.
Sent from my SAMSUNG-SM-N910A
Click to expand...
Click to collapse
Well said..
Only time I have lag on the lockscreen is with a sub par sd card. Once I got rid of that junker the lag went away. Try removing your SD card and see if that fixes the lag.

T989 running very slow?

From last few months, I've been noticing a major slow down in my device. It lags a lot freezes while opening almost any app making the phone almost unusable for daily basis. I don't know what's causing the slow down.
Here's what I've already tried with no positive results:
- Completely formatting SD card + Internal storage and Flashing stock ROM
- Completely formatting SD card + Internal storage and Flashing CM ROM with all android versions (4.1, 4.2, 4.3, 4.4, 5.0, 6.0)
- Frequently cleaning cache partition and wiping all application's cache.
I also have very few apps installed on my phone and there are no major load on the RAM as well.
I am wondering what can cause such slow down?
As far as I remember, this device wasn't that much slower when I first got it about 2 years back.
Does Google services are causing incompatibility with this device causing freezes or this is a hardware issue? (If it is, then which part of hardware could it be?).
Also do you also experience such slow downs, lags and freezing?
You can try to change your kernel and modify a few things. I really suggest using Wild Kernel and downloading the Trickster MOD app on Playstore and change your settings. I usually set my Governor to "ondemand" and it's worked pretty well. I used to have this problem too back when I had the phone on "batterysaver" and it was a mess.
I agree with the kernel tweaks. I"ve noticed that this device does NOT like to go below about 250mb free ram. I've set my LMK settings very aggressively. Accept for foreground applications, I've set everything to 3x normal.
I too am using On demand, tweaked.
I/O set to BFQ
I also like to run Chainfire's Recently (check the playstore) and I set it to max 6 apps with a limit of 6 hours. I only allow 2 Google search instances, no settings screens and I set it to remove each apps documents as well.
With the above, I experience very few slowdowns any more. I should add, that I am using MM roms.

RAM BOOST

Hi to everyone. I'm comming from OnePlus 5t and I don't have any experience with "Ram boost" that we have on Oneplus 7t (Settings/System)... Also I didn't find many explanations by searching (neither here on XDA nor at Google search).
So basically, how it work and is there any benefit except gaming, (and I don't use mobile for gaiming) in real life?
I can't recall is it On or Off by default?
And last but not least, how it's effect battery life?
Thank you.
From what I read, it works like windows superfetch.
When ram usage is not taxed, it will fill the free ram with apps it knows you use frequently. Presumably as with windows, it keeps them in an off state, but when you open the app, it doesn't need to load it in to ram from flash storage, so it can load much much quicker.
There won't be any battery drain.
When ram usage is needed by say a game, it'll kick these auto cached apps out.
I've been using the OP7T for close to a month. I've experienced lag while using various apps, and especially when switching between apps. Occasionally the system becomes temporarily unresponsive, and a handful of apps have crashed multiple times. My previous OP3 phone rarely lagged, even if I had tens of apps open. I've been using the RAM booster on the 7T, but today I spent some time removing and freezing apps that were consuming tens of MB of memory in the background.
personally I didn't had any glitch or lag... I didn't saw any different.
But I don't recall is it turned on or off by default.
Anyway thank you both for comments and making it more clear to.

Categories

Resources