Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
This repository was archived by the owner on Sep 12, 2026. It is now read-only.
This repository was archived by the owner on Sep 12, 2026. It is now read-only.

[OxygenOS] 9.0.4 - Incorrect swappiness value / Frequent lag on Oneplus 5 #50

Open

Description

@sxravan

Hello,

I have rooted my OnePlus with with OxygenOS 9.0.4. I was navigating through all files and found that the value for the swappiness is 100.

$ su -c "cat /proc/sys/vm/swappiness"
100

To be noted that swappiness is the value which affects how aggressively a Linux system should use swap. 100 => always use swap, 0=> swap, but less aggressively.

Can you please add the value of 0 as default for your future OxygenOS release ?

I have made a quick fix on my phone, adding this code to a bashrc on termux. Everytime I reboot my phone, the first thing to do is open Termux to change the swappiness value.

$ cat .bashrc
ACTUALVAL=$(su -c "cat /proc/sys/vm/swappiness")
if [ $ACTUALVAL -ne 0 ]; then
        su -c "sysctl -w vm.swappiness=0"
fi

Since then, my device has stopped being laggy, playing games (Asphalt 9), still no swap is being used.

$ uptime
 14:32:24 up 1 day, 18:13,  load average: 4.33, 4.65, 5.01
$ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.5Gi       4.8Gi       103Mi        20Mi       2.7Gi       2.6Gi
Swap:         1.0Gi          0B       1.0Gi

Regards,
Shravan

Activity

  1. sxravan commented on Apr 12, 2020

    @sxravan
    Author

    With the .bashrc fix, my swappiness is always 0.

    $ su -c "cat /proc/sys/vm/swappiness"
    0
    

    Is there any way to persist this change? On Linux platforms (servers, desktop), the change can be persisted in /etc/sysctl.conf, is there an equivalent for OxygenOS ?

    Regards,
    Shravan

  2. vaahi commented on Apr 12, 2020

    @vaahi

    I did the same thing and wowwwwwwwwwwwwwwwwwww no more lags now :) My oneplus works perfectly fine ^^

  3. GirishMahabir commented on Apr 12, 2020

    @GirishMahabir

    Only got positive results till now!!
    Working just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions