<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Memory and disk totals, how are they calculated?]]></title><description><![CDATA[<p dir="auto">I am curious how the memory and disk totals are calculated. The reason I ask is because in Cloudron it shows the following:</p>
<p dir="auto">Memory: RAM (7.13 GB) + Swap (4.29 GB) in MB<br />
Disk: 11.74 GB of 51.85 GB available</p>
<p dir="auto">However, if I SSH to the server and run the free -h command for memory and the df -h command for disk space, I get different totals.</p>
<p dir="auto">Memory:</p>
<pre><code>total        used        free      shared  buff/cache   available
Mem:           6802        3887         452         535        2462        2090
Swap:          4095        1209        2886
</code></pre>
<p dir="auto">Disk:</p>
<pre><code>Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        49G   38G   11G  78% /
</code></pre>
<p dir="auto">The most pressing example is my external disk for backups... it is a 64 GB block storage disk and Cloudron is calculating it at 67.51 GB, so well over 3 GB larger than it actually is.</p>
<p dir="auto">I'm worried that the values are not being calculated correctly. Knowing how they're currently calculated would be helpful in verifying. It isn't a giant difference, but enough of a difference (particularly on the disk space front) that I'd just like to do a little digging.</p>
]]></description><link>https://forum.cloudron.io/topic/2576/memory-and-disk-totals-how-are-they-calculated</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 18:52:02 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/2576.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 May 2020 19:39:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Sat, 23 Apr 2022 16:08:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a>,<br />
Just lost a lot of time on a bug related to storage and I then discover that what shows in the cloudron UI was in fact Binary, can be updated the label to the correct one with the "i" in-between letters, so that it's clear what unit of measurement is been used?</p>
<ul>
<li>KiB	kibibyte</li>
<li>MiB	mebibyte</li>
<li>GiB	gibibyte</li>
</ul>
<p dir="auto">I know that is a stupid thing to complain but it can save some time on understanding what's happening sometimes.</p>
]]></description><link>https://forum.cloudron.io/post/46521</link><guid isPermaLink="true">https://forum.cloudron.io/post/46521</guid><dc:creator><![CDATA[MooCloud_Matt]]></dc:creator><pubDate>Sat, 23 Apr 2022 16:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Sat, 30 May 2020 00:25:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> That's perfect, thank you so much! <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=af5271e93de" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":-)" alt="🙂" /></p>
]]></description><link>https://forum.cloudron.io/post/8963</link><guid isPermaLink="true">https://forum.cloudron.io/post/8963</guid><dc:creator><![CDATA[d19dotca]]></dc:creator><pubDate>Sat, 30 May 2020 00:25:53 GMT</pubDate></item><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Sat, 30 May 2020 00:14:39 GMT]]></title><description><![CDATA[<p dir="auto">Using SI units for disk size was not a conscious choice. I think what happened is that I used binary units when doing memory related code and <a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> used SI units for disk related code. I think it makes sense to use binary units everywhere especially since most people are probably not going to pass <code>--si</code> etc to the tools. In fact, I didn't know about them until I was trying to find the discrepancy in the graphs and the tools myself.</p>
<p dir="auto">I opened an issue for next release - <a href="https://git.cloudron.io/cloudron/box/-/issues/689" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/cloudron/box/-/issues/689</a></p>
]]></description><link>https://forum.cloudron.io/post/8960</link><guid isPermaLink="true">https://forum.cloudron.io/post/8960</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Sat, 30 May 2020 00:14:39 GMT</pubDate></item><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Fri, 29 May 2020 22:23:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> It's a 7 GB machine, which is probably why it's an odd number. Here's the output of the command you requested in case this helps:</p>
<pre><code>ubuntu@my:~$ cat /proc/meminfo
MemTotal:        6965748 kB
MemFree:          323536 kB
MemAvailable:    2480972 kB
Buffers:          733972 kB
Cached:          1456664 kB
SwapCached:       296884 kB
Active:          2840428 kB
Inactive:        2504388 kB
Active(anon):    1754880 kB
Inactive(anon):  1901776 kB
Active(file):    1085548 kB
Inactive(file):   602612 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4194300 kB
SwapFree:        2349720 kB
Dirty:                68 kB
Writeback:             0 kB
AnonPages:       2960480 kB
Mapped:           620172 kB
Shmem:            513068 kB
Slab:            1039824 kB
SReclaimable:     761684 kB
SUnreclaim:       278140 kB
KernelStack:       33488 kB
PageTables:       137352 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     7677172 kB
Committed_AS:   15388884 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:     1527664 kB
DirectMap2M:     5640192 kB
</code></pre>
]]></description><link>https://forum.cloudron.io/post/8958</link><guid isPermaLink="true">https://forum.cloudron.io/post/8958</guid><dc:creator><![CDATA[d19dotca]]></dc:creator><pubDate>Fri, 29 May 2020 22:23:28 GMT</pubDate></item><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Fri, 29 May 2020 22:21:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> Ah interesting, I see. So I ran df -H and it does indeed show 52 GB instead of 49 GB for the root drive. This is the first I had seen that sort of command. I've always used the lowercase h for example.</p>
<p dir="auto">Here's the thing though and where I could see there being confusion (thus the "confusion is endless" part)... you mention that you use SI units (1000) instead of binary units (1024), however that seems to only apply to the OS level queries. I say that because setting up resources on individual apps in Cloudron is all done in binary (1024) not SI units. The minimum memory for WordPress for example isn't 200, it's 256.</p>
<p dir="auto">I think that inconsistency is possibly confusing for people, particularly since your technical audience typically deals in 1024 rather than 1000.</p>
<p dir="auto">Is it a possibility to use the binary values in calculating disk size instead? Is there a benefit to using the SI units instead of binary?</p>
]]></description><link>https://forum.cloudron.io/post/8957</link><guid isPermaLink="true">https://forum.cloudron.io/post/8957</guid><dc:creator><![CDATA[d19dotca]]></dc:creator><pubDate>Fri, 29 May 2020 22:21:40 GMT</pubDate></item><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Fri, 29 May 2020 21:45:27 GMT]]></title><description><![CDATA[<p dir="auto">The SI units (1000) vs Binary units (1024) confusion is endless. We use SI units for disk size and Binary units for memory sizes.</p>
<p dir="auto">Please compare the outputs with <code>df -H</code> (not small -h), and <code>du --block-size=1000</code> and so on.</p>
<p dir="auto">For <code>free</code>, you shouldn't need the --si since we do use binary units.</p>
]]></description><link>https://forum.cloudron.io/post/8955</link><guid isPermaLink="true">https://forum.cloudron.io/post/8955</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Fri, 29 May 2020 21:45:27 GMT</pubDate></item><item><title><![CDATA[Reply to Memory and disk totals, how are they calculated? on Fri, 29 May 2020 08:41:52 GMT]]></title><description><![CDATA[<p dir="auto">Regarding the memory usage, it is calculated from nodejs' <a href="https://nodejs.org/dist/latest-v12.x/docs/api/os.html#os_os_totalmem" target="_blank" rel="noopener noreferrer nofollow ugc">os.totalmem()</a> call and then divided by 1000 factors according to SI units. Not sure if using base 2 calculation with 1024 is more suitable or not. <code>free -h --si</code> should give you the same as what Cloudron calculates (with rounding due to the -h argument)</p>
<p dir="auto">I am not exactly sure why your total memory in free comes out as 6802 though in <code>free -h</code> what are your server specs here. What does <code>cat /proc/meminfo</code> tell you?</p>
<p dir="auto">The same applies to disk space, where we also follow SI units. But I remember <a class="plugin-mentions-user plugin-mentions-a" href="/user/girish" aria-label="Profile: girish">@<bdi>girish</bdi></a> having dug into this in much more detail.</p>
]]></description><link>https://forum.cloudron.io/post/8930</link><guid isPermaLink="true">https://forum.cloudron.io/post/8930</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Fri, 29 May 2020 08:41:52 GMT</pubDate></item></channel></rss>