32 comments

  • Lerc11 minutes ago
    I have to wonder if the better solution would be for browsers (and apps that are effectively broswers) to compress their data proactively.<p>I find that the ratio of browserish memory use to that of other programs is enough to render the latter insignificant most of the time.
  • tooheavy2 minutes ago
    Compression is fine as long as the CPU doesn&#x27;t become the bottleneck.
  • Lio4 hours ago
    RAM compression sounds very useful but the thing I really need extra RAM for is local inference.<p>Since the models are effectively highly compressed data already my assumption is that RAM compression won&#x27;t help improve that much (I&#x27;m assuming unified memory here as per the Framework Desktop). A bit like trying to compress a JPEG in a zip file.<p>Could anyone comment on that?
    • strobe0 minutes ago
      it interesting because usually on workstation the browser &amp; electron apps it&#x27;s that holding much of the memory hostage (it&#x27;s very common to see that browser consuming 20-30gb on 64gb system), so may be if it will be significant compression win on that side it leads to more memory for model but how much performance penalty would be for inference in that case?
    • rft4 hours ago
      I haven&#x27;t tried it in RAM, but your reasoning matches what I saw when I looked at compressing weights for archiving them. The weights don&#x27;t compress nicely with standard, especially fast, algorithms. Some more background in this repo [1] including example compression ratios. I would also worry about decompression speed, that gives you a hard bound on the throughput. If the numbers in this repo are accurate, you likely hit the throughput limit of decompression way before you hit the memory limit, even considering the space savings and thus higher effective throughput.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;zipnn&#x2F;zipnn#results" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zipnn&#x2F;zipnn#results</a>
    • matja2 hours ago
      &gt; A bit like trying to compress a JPEG in a zip file<p>Interesting comparison, I wonder if there are loss-less compression schemes that are &quot;weight-aware&quot;, about the statistical properties of model weights.<p>Back to that line - because (Huffman coded) JPEG images can be lossless recoded using arithmetic coding, which makes them smaller than if they were compressed with the best general-purpose compression algorithms&#x2F;tools (e.g. `jpegtran -arithmetic &lt; input.jpg &gt; output.jpg` beats `xz -9 &lt; input.jpg &gt; output.jpg`). AC takes advantage of the properties of the image coding better than general-purpose compression tools on the output of the Huffman coding.
      • rft2 hours ago
        The library I use for archiving compressed raw LLM weights ([1] , posted in my other comment) afaik at least reorders the weights to more easily compress them. They also have a paper linked, which I admittedly didn&#x27;t read, that might have more background and tradeoffs. Likely they will have discussed methods to take advantage of the structure of weights.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;zipnn&#x2F;zipnn#results" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zipnn&#x2F;zipnn#results</a>
    • kalcode4 hours ago
      I don&#x27;t know at all. But I&#x27;ve been playing with oMlx and Splash. Using Pi there are compression extensions like the billion-context. I suspect your right.<p>But all seem to have massive issue boards. What I did see was oMlx release clustering so you can string 3 macs and have 3 times the memory or use one for prefilling accelerating.<p>Which I thought was neat and what I&#x27;ll likely poke at instead of getting more ran.
      • 0123456789ABCDE3 hours ago
        perhaps i&#x27;m not <i>pilled</i> enough for this conversation, but aren&#x27;t you conflating two disparate concepts — model-weights and context-window?
  • Juvination8 minutes ago
    What a fun loop through time. I remember downloading programs to free up ram in the early 2000&#x27;s, then as RAM became more ubiqutous and programs were still small you could run them directly on RAMDisk. (I did this with Path of Exile about 10 years ago to avoid lag.) Now we are working back to getting the most out of our ram.
  • jakozaur4 hours ago
    &gt; Memory compression is not new. If you have a Windows or Mac device you are already using it.<p>Yes, macOS has had it enabled by default since OS X Mavericks 10.9, released in October 2013. I’m surprised some desktop Linux distributions still require manual configuration to enable it.<p>For browser tabs, though, I think a better solution is automatic tab closing, using something like the Tab Wrangler extension for Chrome. Collecting tabs comes naturally; we’re much worse at closing them.
    • xnx45 minutes ago
      Chrome has had a built-in tab-sleeping Memory Saver feature for 4 years: <a href="https:&#x2F;&#x2F;blog.google&#x2F;products-and-platforms&#x2F;products&#x2F;chrome&#x2F;new-chrome-features-to-save-battery-and-make-browsing-smoother&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.google&#x2F;products-and-platforms&#x2F;products&#x2F;chrome&#x2F;n...</a>
    • jve3 hours ago
      Wait, Edge on windows automatically puts tabs to sleep when they are unused (<a href="https:&#x2F;&#x2F;explore.microsoft.com&#x2F;en-us&#x2F;edge&#x2F;features&#x2F;sleeping-tabs?form=MT0160" rel="nofollow">https:&#x2F;&#x2F;explore.microsoft.com&#x2F;en-us&#x2F;edge&#x2F;features&#x2F;sleeping-t...</a>). I think edge weren&#x27;t even the first one, thus being kinda surprised I see chrome needs extension for that?
    • evenfrost3 hours ago
      For Chrome I recommend The Marvellous Suspender, which can auto-suspend unused tabs. Has been a life-saver for me for quite a while.
    • aa-jv3 hours ago
      &gt;I’m surprised some desktop Linux distributions still require manual configuration to enable it.<p>Its a user choice and should be a user-facing knob because there are times it is inappropriate for use, such as in safety-critical circumstances, certain realtime realities, and so on. It should probably be on by default for desktop Linux, but off by default for every other application a distribution may be targeting ...
  • pshirshov3 minutes ago
    Vectors do not compress.
  • sammatilda5 hours ago
    I just discovered zram thanks to claude after installing fedora on a new computer and man I was blown away by both zram and fedora. Fedora amongst the linux distributions for some reasons has really got everything that an end user needs and the whole experience is just way smoother than anything I have used in 25 years on linux.<p>I am hoping to switch my dad from ubuntu to fedora in a month or so because he has 16 GB ram and this seems like something most people dont know.
    • nico4 hours ago
      Wow, very cool. Is this like the old &quot;RAM doubler&quot; for Mac OS (or like Johnny Mnemonic&#x27;s &quot;Pemex MemDoubler&quot;)? :)
    • Lio4 hours ago
      It&#x27;s funny, I switch from Fedora back to Ubuntu last year.<p>I really like Fedora in that it seems very up to date package wise but I found it requires a reboot every time I update using the UI updater.<p>It&#x27;s better using the dnf command but it still felt a bit lumpy compared to apt.
      • mritzmann4 hours ago
        Install &quot;needrestart&quot;, and you&#x27;ll see that a reboot would be useful in Ubuntu, too. Many running programs still use the old version of a shared library even after it has been updated. With so many security updates these days, it almost always makes sense to reboot.
    • amelius3 hours ago
      Could this be one of the tricks the M-series cpus are pulling behind the scenes to make them look faster?
      • jrmg27 minutes ago
        It’s definitely one of the tricks the Neo is pulling behind the scenes to make 8Gb be ‘enough’.
    • speed_spread4 hours ago
      I like Fedora too but I&#x27;m pretty sure Ubuntu also has zram. You just need to enable it.
  • nukanse3 hours ago
    For a programmer, on many cases, it pays to compress the data, to improve RAM IO, because the alu may already be doing nothing meanwhile waiting for the data from ram, so you can use that time to decompress, process, compress, and store the result. A lot of code today is bottlenecked by IO. You spend a lot of effort optimizing with SIMD, processing the data super fast, and then the speed it&#x27;s wssted because there is not enough bandwidth to even send the result to ram. Modern cpu should include more hardware support for memory compression
  • roosgit6 hours ago
    MacOS has been doing this for quite a while now. I was a bit surprised this wasn’t the default for most Linux distros, although I think Pop!_OS (what a name!) has had zram enabled for a few years already. I turned it on on one of my servers (1GB RAM) and it works fine.
  • certyfreak4 hours ago
    I switched to Fedora some time ago and only recently learned about zram. I was hitting full system memory(16GB) during normal use, and after increasing my zram to 16GB, I was blown away. I had initially planned to buy additional ram.
  • cogman1019 minutes ago
    Don&#x27;t use Zram, use Zswap. Especially if you want to swap to disk.<p><a href="https:&#x2F;&#x2F;chrisdown.name&#x2F;2026&#x2F;03&#x2F;24&#x2F;zswap-vs-zram-when-to-use-what.html" rel="nofollow">https:&#x2F;&#x2F;chrisdown.name&#x2F;2026&#x2F;03&#x2F;24&#x2F;zswap-vs-zram-when-to-use-...</a>
    • ciupicri7 minutes ago
      I&#x27;ve tried for running bsdiff and zswap was slower and spilled out data to the disk (which would wear an SSD).
  • fernandogrd19 minutes ago
    Things I did: - Zswap instead of zram. - Unload browser tabs (my own private extension. - Force idle cli AI agents to go to disk swap earlier.
  • aktenlage3 hours ago
    So, if it is used as swap, that means to use the data, it first needs to go to the CPU, then back to regular RAM, then back to the CPU.<p>Isn&#x27;t that wasteful? The CPU&#x27;s caches may help a bit, but I would guess first a huge block is going through the decompression, so only the last bits are still in the cache, when the actual usage starts.
  • rustyhancock4 hours ago
    I&#x27;ve used zswap on most of my systems and generally find it beneficial especially as (de)compression can be very fast these days.<p>What&#x27;s interesting to note is that I&#x27;ve occasionally wondered why isn&#x27;t the swap partition compressed.<p>If you have it on an NVMe drive it probably is as is all data! The controller usually transparently does it as it writes to&#x2F;from NAND.<p>So the kernel sees uncompressed fixed block pages and the speed boosts happen with data arriving faster when read or written to flash.
    • close0417 minutes ago
      &gt; I&#x27;ve used zswap on most of my systems and generally find it beneficial<p>I started using zswap recently but didn&#x27;t have the time yet to benchmark and measure the benefit. Does it benefit machines with low amounts of RAM like 1GB (small headless servers) or better not bother?<p>&gt; If you have it on an NVMe drive it probably is as is all data!<p>In the consumer SSD space the last controllers I know to do on the fly compression were SandForce [1], probably 15 years ago, when minimizing writes and saving the little capacity available was imperative. I don&#x27;t think any other desktop SSDs do this now. A bit more common in enterprise models like ScaleFlux CSD.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;SandForce#Products" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;SandForce#Products</a>
  • baud96003 hours ago
    You’d hope with these amazing GPUs today, that some cycles can be used to compress RAM very efficiently. So many parallel cores, surely we can get even better compression from this latent hardware?
  • 72deluxe2 hours ago
    Having viewed that page, I cannot fathom how Firefox is using 27GB of RAM in his screenshot?!
  • ChrisRR4 hours ago
    &gt; Compressing memory does not come with downsides. It takes a little bit more from your CPU and adds latency to some processes<p>It sounds like those are downsides
    • Ecno923 hours ago
      I believe I have written this not in the best way. (I have uploaded a slightly improved version)<p>I did not really notice a large performance impact.<p>Unless you are in an environment where compute performance is critical, I think this is something interesting to try.
    • Rohansi4 hours ago
      It&#x27;s basically in-memory swap. If you have swap then you already have the added latency (but worse) and I&#x2F;O usage instead of CPU. Like swap, the downsides only come into play under high memory pressure.
    • aa-jv3 hours ago
      They are downsides in cases where an application has to escalate a critical fault as quickly as possible - indeed where every nanosecond counts - and a process waiting for page restoration is going to be delayed even an intolerable amount.<p>It should be a user switch and probably will become one in most Linux desktop distributations, I would wager. However, I would not enable it - I run Ubuntu Studio for every last little bit of latency it gives me in a realtime audio-capture application, and on those systems were it to become default-on by way of distro update, I&#x27;d be kinda miffed.
    • xxs4 hours ago
      That&#x27;s a terrible statement. Perhaps it can apply to certain setups where compression (and decompression) shows decent results, in lots of applications it&#x27;d be a massive downgrade.
      • Rohansi4 hours ago
        zram does not compress all of your RAM. It only compresses inactive blocks of memory that would be eligible for swap, if you had swap enabled.
      • aa-jv3 hours ago
        The distinction is in the distribution - is the Linux bootable for an end user or is it for a rack-mount industrial application - since anyway the kernel configuration has to be involved to have zswap effectively applied at kernel runtime.
    • Stitch42233 hours ago
      They are not selling it well.<p>It’s like saying that in order to breathe you have to use your nose or mouth. Which is bad if you want to retain the oxygen that is inside your lungs.<p>There are always scenario’s where memory compression is an outright bad idea. Just like trying to breathe under water.
    • MadameMinty4 hours ago
      &quot;does not come without downsides&quot; + &quot;does come with downsides&quot; race condition
  • fred_is_fred16 minutes ago
    What&#x27;s old is new again! <a href="https:&#x2F;&#x2F;apple.fandom.com&#x2F;wiki&#x2F;RAM_Doubler" rel="nofollow">https:&#x2F;&#x2F;apple.fandom.com&#x2F;wiki&#x2F;RAM_Doubler</a>
  • kiicia4 hours ago
    nice try Ram Altman
  • Ecno926 hours ago
    Since I am using Claude with parallel sessions in different workspaces I started to run out of RAM.<p>Instead of buying more RAM, which meant that I should replace my device, I decided to implement zram. This compresses memory. Now I can do more with the same hardware.<p>In many cloud environments compression is not enabled. I am curious to see if the same gains can be made in such environment.
    • XYen0n5 hours ago
      You can enable it yourself, for example using <a href="https:&#x2F;&#x2F;github.com&#x2F;systemd&#x2F;zram-generator" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;systemd&#x2F;zram-generator</a>.
      • Ecno923 hours ago
        I did! I am actually the author of the post! ;-)
        • aa-jv3 hours ago
          Great article, thanks for sharing the details .. only thing I&#x27;d add is that you should put a bit of emphasis on the fact that this is not a one-size fits-all setting - users should very much apply it when appropriate to their latency budgets...
  • yummybear4 hours ago
    &quot;Compressing memory does not come with downsides. It takes a little bit more from your CPU and adds latency to some processes&quot;<p>Which one is it?
  • LoganDark3 hours ago
    Windows doesn&#x27;t do memory compression if the page file is not enabled. I never particularly saw the point of the page file because I don&#x27;t enjoy swapping, but it appears that the memory management system disproportionately depends on it to the point where it simply refuses to work properly with it off. So make sure that&#x27;s turned on if you want memory compression. (Do not let it auto-size or it will happily fill up your whole drive, set it to something reasonable)
  • cubefox3 hours ago
    So why is zswap (basically zram+swap) not enabled by default everywhere?
    • aa-jv3 hours ago
      Because it is a user choice, and there are applications where it is inappropriate. For desktop Linux it should probably be on, as long as its clear to the user - but yeah, for many other Linux use cases its inappropriate.
      • jrmg25 minutes ago
        “Because it is a user choice”<p>That’s true of everything. Default setups make those choices.
      • cubefox2 hours ago
        Maybe it should generally be on and and only switched off when it is inappropriate.
        • cestith20 minutes ago
          Maybe it should be generally on for desktop-focused distros and generally off for server-focused ones. The distros that focus on doing both well might want to recommend it in the installer when told it&#x27;s primarily a desktop installation and explain the tradeoffs.<p>For a server, it really depends on what kind of service you&#x27;re providing whether it would be helpful. We might want to let server admins, SREs, production engineers, or platform engineers to make an active decision about it.
  • dist-epoch4 hours ago
    &gt; If you have a Windows or Mac device you are already using it<p>Technically yes, practically on Windows memory compression is not used.<p>I have Windows 11, 128 GB RAM, and my memory stats show: 42 GB in use, 380 MB compressed.
    • sheo4 hours ago
      You have plenty of RAM free. Compressing at that point is increasing latency for no good reason. Unused RAM is wasted RAM<p>I&#x27;m a Linux user myself, but I think it would start compressing it when there would be less than 25% free
  • jauntywundrkind4 hours ago
    In many systems, adding compression makes not just storage better but increases the io you get from a system too. Here&#x27;s Valkey 9.2 compression figures showing that: <a href="https:&#x2F;&#x2F;www.phoronix.com&#x2F;news&#x2F;Valkey-9.2" rel="nofollow">https:&#x2F;&#x2F;www.phoronix.com&#x2F;news&#x2F;Valkey-9.2</a><p>That&#x27;s for RDB persistence. <a href="https:&#x2F;&#x2F;valkey.io&#x2F;topics&#x2F;persistence&#x2F;" rel="nofollow">https:&#x2F;&#x2F;valkey.io&#x2F;topics&#x2F;persistence&#x2F;</a><p>I wonder if there&#x27;s any similar wins with ram? That some workloads would see net wins from compression. Some cost of cpu, but increasing net throughput significantly.
  • hinkley3 hours ago
    Okay, Johnny Mnemonic.
  • mzhaase5 hours ago
    Zram vs Zswap: <a href="https:&#x2F;&#x2F;chrisdown.name&#x2F;2026&#x2F;03&#x2F;24&#x2F;zswap-vs-zram-when-to-use-what.html" rel="nofollow">https:&#x2F;&#x2F;chrisdown.name&#x2F;2026&#x2F;03&#x2F;24&#x2F;zswap-vs-zram-when-to-use-...</a><p>&gt; If in doubt, prefer to use zswap. Only use zram if you have a highly specific reason to.<p>&gt; In terms of architecture:<p>&gt; zswap sits in front of your disk swap, compresses pages in RAM, and automatically tiers cold data to disk. It integrates directly with the kernel&#x27;s memory management and distributes pressure gracefully.<p>&gt; zram is a compressed RAM block device with a hard capacity limit. When you put swap on it and it fills up, there is no automatic eviction, and the kernel has very little leverage to do anything about the situation. The system either OOMs or falls back to lower-priority swap, causing LRU inversion (see below). It only really makes sense for extremely memory-constrained embedded systems, diskless setups, or cases with specific security requirements around keeping private data off persistent storage. Swap on zram is also increasingly unsupported upstream.
    • keybored3 hours ago
      I enjoyed that Zram article a lot way back when.<p>( <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=47500746">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=47500746</a> )<p>It’s long and more satisfying than this In These AI Times wrapper.
    • speed_spread4 hours ago
      What if I loathe swap? The I&#x2F;O hit of hitting swap, even with SSD, always mean a severely degraded desktop experience. I often end up closing applications to free up RAM or would just order more RAM back when it didn&#x27;t involve taking a third mortgage.<p>I would rather have the system tell me there&#x27;s not enough memory than try to pretend there&#x27;s an infinite amount of it and then slow to a crawl without apparent reason. Unix memory allocation is daft. Desktop swap to block never worked, never will.
      • izacus7 minutes ago
        You seem to be fundamentally misunderstanding what zswap is and are instead griping about something unrelated.
  • ejazarain3 hours ago
    [flagged]
  • VCFundedGenYer42 minutes ago
    [dead]
  • messe5 hours ago
    Use zswap not zram if you have a backing device:<p><a href="https:&#x2F;&#x2F;linuxblog.io&#x2F;zswap-better-than-zram&#x2F;" rel="nofollow">https:&#x2F;&#x2F;linuxblog.io&#x2F;zswap-better-than-zram&#x2F;</a><p><a href="https:&#x2F;&#x2F;chrisdown.name&#x2F;2026&#x2F;03&#x2F;24&#x2F;zswap-vs-zram-when-to-use-what.html" rel="nofollow">https:&#x2F;&#x2F;chrisdown.name&#x2F;2026&#x2F;03&#x2F;24&#x2F;zswap-vs-zram-when-to-use-...</a>
  • DeathArrow4 hours ago
    I have built my PC with core i7 14700K, RTX 3090,128 GB DDR3, 2TB SSD, 8TB HDD about 3 years ago.<p>Still perfectly usable and I won&#x27;t upgrade until prices come down. Even used prices are terrible now.
    • globular-toast4 hours ago
      Mine is an i7 4790K with 32GB of RAM and it&#x27;s more than usable, I find it quite nippy.<p>The main thing I regret is not maxing out the memory on my server. At first 32Gi seemed more than I&#x27;d ever need, but now it&#x27;s feeling quite anaemic.
    • theandrewbailey4 hours ago
      &gt; 128 GB DDR3<p>Typo DDR5?
      • DeathArrow3 hours ago
        Yes, it was a typo, I use DDR4.
      • xxs4 hours ago
        of course, it supports only that type of memory. 128GB on a desktop 2 ram channel machine is massive, too
        • theandrewbailey4 hours ago
          14700K supports both DDR5 and DDR4:<p><a href="https:&#x2F;&#x2F;www.intel.com&#x2F;content&#x2F;www&#x2F;us&#x2F;en&#x2F;products&#x2F;sku&#x2F;236783&#x2F;intel-core-i7-processor-14700k-33m-cache-up-to-5-60-ghz&#x2F;specifications.html" rel="nofollow">https:&#x2F;&#x2F;www.intel.com&#x2F;content&#x2F;www&#x2F;us&#x2F;en&#x2F;products&#x2F;sku&#x2F;236783&#x2F;...</a>