ZRAM is insane

I got a cheap netbook style laptop for traveling some weeks ago (HP Stream 11" with 4 GB of RAM and a N4120). Didn’t expect much more from this hardware than opening a few browser tabs and doing some retro gaming via Steam.

Shared RAM with graphics card means that 3.64 GB of RAM are effectively usable for the OS. This was even too little RAM to open a handful of tabs w/o having tabs being unresponsive for seconds sometimes in a very annoying way. Another thing which made trouble was the Wifi - I guess it went into power saving, was swapped and didn’t load fast enough to provide a good experience. (Of course I wasted an hour checking for Wifi drivers/support.)

In short: Even for my low expectations for this laptop it was an underwhelming experience.

First step was to look at my vm.swappiness and set it to 10, which already helped, but still the machine had hiccups and annoying timeouts.

In a last, desperate effort I enabled ZRAM on the laptop… and literally WTF: Saying it is a night and day difference doesn’t do the experience justice. Typing this words now on the Stream, which I use exactly the same way as my much more beefy other machines (my next worst computer has 8G of RAM and an Intel Core i3), browsing with 10 open tabs, e-mail client open on another virtual desktop… it is crazy, it makes the Stream fun to use and I use it at home for everything which isn’t heavily CPU/IO bound.

What surprised me the most: No hiccups, no timeouts and it even fixed the Wifi issues on this little machine. Didn’t expect this would be possible, especially with a N4120 and 3.64 GB of RAM.

In short, my laptop changed from not even reaching my low/realistic expectations to being my favorite technical purchase of the last years, thanks to ZRAM.

Besides making this a ZRAM appreciation post, I really want to spread the word about it. Especially for old hardware and limited RAM situations, IMHO it should be the first thing which comes to mind/is recommended.

Fedora and PopOS use it by default, so it is well tested and should IMHO again, be a default at least for desktop setups.

Give it a try - supposedly it even improved the experience on much more beefy computers for gaming etc.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • localhost
  • All magazines
  • 200 @ entry_single
    HTTP status 200 OK
    Route name entry_single
    Has session yes
    Stateless Check no
    Time 740 ms
    Total time 740 ms
    Initialization time 152 ms
    Memory 12.0 MiB
    Peak memory usage 12.0 MiB
    PHP memory limit 128 MiB
    Cache 1
    Number of forms 1
    Number of errors 0
    Logger 89
    Errors 0
    Warnings 0
    Deprecations 89
    Cache 55 in 368.03 ms
    Cache Calls 55
    Total time 368.03 ms
    Cache hits 39 / 59 (66.1%)
    Cache writes 14
    640
    Default locale en
    Missing messages 640
    Fallback messages 0
    Defined messages 148
    Security n/a
    Authenticated No
    Firewall name main
    Twig 418 ms
    Render Time 418 ms
    Template Calls 86
    Block Calls 82
    Macro Calls 6
    54 in 372 ms
    settings_row_switch 15
    user_avatar 12
    user_settings_row_switch 4
    date 3
    user_inline 2
    settings_row_enum 2
    entry 1
    date_edited 1
    vote 1
    boost 1
    entries_cross 1
    editor_toolbar 1
    user_actions 1
    magazine_box 1
    magazine_sub 1
    related_magazines 1
    active_users 1
    related_categories 1
    related_posts 1
    related_entries 1
    support_us_block 1
    featured_magazines 1
    15 in 297.72 ms
    Database Queries 15
    Different statements 12
    Query time 297.72 ms
    Invalid entities 0
    Cache hits 33
    Cache misses 3
    Cache puts 3
    6.4.0
    Profiler token 0e58f4
    Environment dev
    Debug enabled
    PHP version 8.2.26   View phpinfo()
    PHP Extensions Xdebug ✗ APCu ✓ OPcache ✓
    PHP SAPI apache2handler