I have a full node on both an Ubuntu 16.04 LTS and a Windows 10 device.
Why is the database file containing blockchain a different size on each OS?
Monero Stack Exchange is a question and answer site for developers and users of the secure, private and untraceable cryptocurrency Monero. It only takes a minute to sign up.Sign up to join this community
You are probably looking at a database file with the blockchain in it. The main variation cause is that the database library Monero uses, LMDB, preallocates some space for writing. Every so often, when that space falls too low, LMDB will resize the file to get more breathing space.
Some OSes do not support sparse files - that is, files with "holes without data" in them. So these will actually have allocated space with data there, instead of just nothing, which makes the file larger than it'd be on an OS which supports sparse files.
It also depends on the version of Monero that is running. Recent versions have made optimizations which shrink the size of the database without impacting performance.
Last, it should be noted that this database is a few times larger than the actual blockchain data. This is because a database is geared towards reading the data back in an efficient matter, so data is stored denormalized (ie, with some duplicated parts, etc).
The previous answers are correct, but there are plenty of other reasons for size variations. The timing and order in which records are written will also affect the way space is allocated in the database, and if the two nodes didn't run in lockstep then they'll get batches of blocks at different times as well as alternate blocks at different times.
Probably because Windows, by default, reports file sizes in KiB/MiB/GiB/TiB (1024 bytes in a kilobyte, 1024 kilobytes in a megabyte, etc.), while Ubuntu, by default reports file sizes using the "proper" SI definition of those prefixes (1000 bytes in a kilobyte, 1000 kilobytes in a megabyte, etc.).
There's also the issue that the underlying file systems are different, so they don't store files the same way, which can lead to different sizes for the same data, depending on configuration. You haven't shared any of that information with us, but various file system configurations, such as cluster size can have a noticeable effect on how much disk space it takes to store a file.