When Windows 11 is using the RAM disk for an extended period of time (21 days on the screenshot), the RAM disk starts reporting used space that isn't linked to any files. In the picture you see that the only folder on the drive reports a "Size on disk" of 2.12 GB while the RAM disk reports 12.3 GB of used space.
When the RAM Disk application starts, this is not the case. Rather, it is slowly getting worse over time.
I discovered the reason. It's because of the "Allow files on this drive to have contents indexed in addition to file properties" setting on the RAM disk.
Is there any way to disable this by default when the RAM disk gets created?