开发者生态
morning
不买RAM,压缩
摘要
AI has changed a lot. We do more work in parallel. This increases the memory demand on our workstations. Also, memory is expensive and often not extendable. So buying more RAM is not an easy option. R...
com
the
not
memory
have
more
compression
RAM
our
you
2026-11-19
1 阅读
约7分钟阅读
Ecno92
字号:
人工智能发生了很大变化。我们同时做更多的工作。这增加了我们工作站的内存需求。此外,内存价格昂贵且通常不可扩展。因此购买更多内存并不是一个简单的选择。最近我的内存不足了,我在 zram 中找到了我的解决方案,一个压缩内存的解决方案。内存压缩并不是什么新鲜事。如果您有 Windows 或 Mac 设备,则您已经在使用它。此外,许多 Android 智能手机利用压缩技术将更多数据放入 RAM 中。不幸的是,并非所有 Linux 环境都默认启用 RAM 压缩。 Fedora、Pop!_OS 可以,但 Ubuntu 不行。 Amazon Linux 仅在较小的虚拟机上启用 zram。大多数其他发行版都没有启用它。压缩内存并没有缺点。它会占用更多的 CPU 资源,并会增加某些进程的延迟。然而,您获得的是大量的额外容量。压缩比高达 1:4 的情况并不罕见。我记得在编写 SaaS 软件的早期,当我们向单体应用程序添加更多功能时,我们通常需要双倍的机器大小。通常,CPU 承受的压力很小,因此如果启用 RAM 压缩,我们就可以避免升级。这可能会使我们的云支出减少一半!实际情况如何 我在 Firefox 中打开了很多网站。这么多,几乎占满了所有系统内存。 (我有 32GB,其中一些保留用于图形)供您在 nos.nl nu.nl telegraaf.nl ad.nl volkskrant.nl nrc.nl rtl.nl tweeters.net buienradar.nl ns.nl npo.nl \ bbc.com/news Edition.cnn.com theguardian.com nytimes.com reuters.com apnews.com aljazeera.com dw.com spiegel.de柠檬de.fr Washingtonpost.com Bloomberg.com \ theverge.com arstechnica.com techcrunch.comwired.com engadget.com phoronix.com lwn.net news.ycombinator.com tomshardware.com \ github.com/torvalds/linux github.com/microsoft/vscode github.com/rust-lang/rust stackoverflow.com/questions gitlab.com Developer.mozilla.org docs.python.org kernel.org ubuntu.com Huggingface.co \ youtube.com "youtube.com/results?search_query=linux" "youtube.com/results?search_query=music" "youtube.com/results?search_query=documentary" twitch.tv vimeo.com dailymotion.com soundcloud.com open.spotify.com \ reddit.com reddit.com/r/linux reddit.com/r/worldnews reddit.com/r/pics reddit.com/r/technology x.com instagram.com linkedin.com pinterest.com tumblr.com imgur.com 9gag.commedium.com quora.com \ bol.com Coolblue.nl marktplaats.nl amazon.nl amazon.com ebay.com aliexpress.com ikea.com/nl/nl zalando.nl etsy.com mediamarkt.nl ah.nl \ google.com/maps openstreetmap.org booking.com airbnb.com tripadvisor.com klm.nl schiphol.nl \ en.wikipedia.org/wiki/Linux en.wikipedia.org/wiki/Netherlands en.wikipedia.org/wiki/Amsterdam en.wikipedia.org/wiki/World_War_II nl.wikipedia.org/wiki/Nederland \ imdb.com rottentomatoes.com archive.orgNationalgeographic.com nasa.gov flickr.com/explore espn.comweather.com\canva.comfigma.com notion.so trello.com office.com dropbox.com wikihow.com ;执行 firefox --new-tab "https:// $u " >/dev/null 2 > & 1 ; sleep 1 done 如果我们查看正在运行的应用程序,那么我们会发现它不适合。在内存使用情况中,我们看到 zram 交换空间中有一些需求。在终端中我们可以检查使用了多少内存,并且可以计算压缩率。 1.7G RAM 中有 5.7G 数据。即压缩比为 1:3.35。入门 压缩 RAM 不仅可以帮助您充分利用自己的硬件,还可以充分利用云环境。用更少的钱做更多的事。 Arch Linux wiki 有一篇关于如何入门的好文章。期待听到您的经历。
这篇文章对您有帮助吗?
订阅66必读
每日精选科技资讯,直达你的邮箱