<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Swap on Linux Café</title>
    <link>https://mrtomlinux.org/tags/swap/</link>
    <description>Recent content in Swap on Linux Café</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 29 Sep 2026 09:15:51 +0200</lastBuildDate>
    <atom:link href="https://mrtomlinux.org/tags/swap/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Why my 4GB Raspberry Pi 4 keeps swapping during a Python script – and how I fixed it by moving swap to USB</title>
      <link>https://mrtomlinux.org/post/2026-09-29-why-my-4gb-raspberry-pi-4-keeps-swapping-duri/</link>
      <pubDate>Tue, 29 Sep 2026 09:15:51 +0200</pubDate>
      <guid>https://mrtomlinux.org/post/2026-09-29-why-my-4gb-raspberry-pi-4-keeps-swapping-duri/</guid>
      <description>&lt;h2 id=&#34;why-the-pi-keeps-swapping&#34;&gt;Why the Pi keeps swapping&lt;/h2&gt;&#xA;&lt;p&gt;I was running a memory‑hungry Python data‑pipeline on a 4 GB Raspberry Pi 4 when the system started thrashing every few minutes. &lt;code&gt;top&lt;/code&gt; was showing swap usage climbing to 90 % while my script was still busy. The Pi’s 4 GB RAM was the hard limit, and the default swap file on the SD card was the culprit.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-culprit&#34;&gt;The culprit&lt;/h3&gt;&#xA;&lt;p&gt;The SD card is the only storage medium on the Pi, but it’s also the slowest. When the kernel starts paging, it writes to the swap file on the card, creating I/O bottlenecks that stall the Python interpreter. The swap file is defined in &lt;code&gt;/etc/fstab&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
