<p>Jenkins is failing to build due to "Free Swap Space" being 0. I don't know how to fix that. The build process keeps hanging. Here part of the output:</p>

<p><a href="https://i.stack.imgur.com/2Ceeo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2Ceeo.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/crw7E.png" rel="noreferrer"><img src="https://i.stack.imgur.com/crw7E.png" alt="enter image description here"></a></p>

<p>When I ssh into the instance and <code>docker info</code> I get a <code>WARNING: No swap limit support</code>. </p>

<p>Your screenshot shows "waiting for next available executor" so try increasing the number of executors in jenkins ("Manage Jenkins" -> "Configure System" -> "# of executors").</p>

<p>Also here the info how to create Swapfile (for avoiding out of memory on building large docker containers etc.). The example creates 4G swapfile at location /myswap :</p>

<pre><code>sudo dd if=/dev/zero of=/myswap count=4096 bs=1MiB
sudo chmod 600 /myswap
sudo mkswap /myswap
sudo swapon /myswap
</code></pre>

<p>to check swap is working:</p>

<pre><code>swapon -s
</code></pre>

<p>enable swap at boot, add line to fstab file:</p>

<pre><code>sudo nano /etc/fstab
</code></pre>

<p>Add this line:</p>

<pre><code>/myswap   swap    swap    sw  0   0
</code></pre>
