4 ms·
Fun project! Recommended RAM to run Windows 95 was 8MB, curious to find out how much this uses to emulate everything around the OS.
by mysterydip 4y ago
Fun project! Recommended RAM to run Windows 95 was 8MB, curious to find out how much this uses to emulate everything around the OS.
- mherrmann 4y ago2GB for Electron, 8MB for Windows.
- jchw 4y agoJust ran it to find out. On my machine, about 292 MiB, with the default machine, which seems to give about 128 MiB to the VM. That's measured using the sum of private working sets of all processes, since Electron/Chromium is multi-process. This actually doesn't seem like such a bad outcome, though, I don't know how it will scale if you increase the amount of RAM available to the VM.
- AndrewThrowaway 4y agoSo ~35 times overhead seems like an OK outcome... This what development has become!
- jchw 4y agoI know replying to this is wrong, but what the hell. 1. The underlying machine has 128 MiB of RAM, not 8 MiB. Windows 98 can run with 8 MiB of RAM, but that's not what they did here. My family had a Windows 9x computer when I still lived with my parents, and before we retired it, it had 512 MiB of RAM. 2. Dividing the memory usage by the guest machine's amount of memory does not seem like a good approach to calculate the overhead. There may be some per-byte-of-RAM overhead, but I bet it's more likely that the memory overhead does not scale much with guest machine RAM, since it is probably just a giant arraybuffer. 3. Compared to what? I'm going to go out on a limb and say that most virtual machine software has RAM overhead of some kind, so we need to establish at least some reasonable baseline if we're really going to try to figure out how within reason this is. (Expounding on the last point, people are happy to spend a lot of resources on emulation, certainly well exceeding "35x overhead" in some cases. And at that point, we are talking about overhead that would scale.)
- vel0city 4y agoIts 1.2x not 35x. 282MiB used on the host to run the VM with 128MiB of available RAM inside so 154MiB overhead.
- justsomehnguy 4y agoAvailable != used. Actual total usage could be bigger if all memomry in the VM would be consumed.
- jchw 4y agoI am pretty sure v86 allocates all of the memory ahead of time, using one big array buffer. It’d probably be easy to find the code. However, that doesn’t mean that Chrome is actually allocating it all at once. It could very well be paging it in on demand. I have no idea. In that case, to measure the overhead, you’d need to fill the guest memory. I didn’t bother looking into it that deeply because I don’t really think it’s that interesting; an Electron x86 emulator is pretty impractical no matter how you shake it. It’s still pretty funny, though.
- postalrat 4y agoGuessing you don't write emulators. Or even read linked articles.
- mikewhy 4y agoThey don't even read the comment they're replying to.
- mysterydip 4y agoAgreed, that doesn't seem too bad for the RAM they gave the system. Wonder how stable that number is when things are running? My assumption is it should be about the same since electron is running the emulation program, regardless of what the OS does.
- codedokode 4y agoThis is not a correct measurement. You should also account for memory used by shareable data like binary and libraries, and memory swapped out. On Linux, one can add PSS to get more or less accurate number.
- jchw 4y agoTo be fair, there was no memory pressure, and as such nothing was swapped out. (I checked. The active private set was equal to the private set.) Counting shared memory would not have dramatically changed the value, if I am not mistaking, but Windows Task Manager does not have a good built-in way to do so without counting the same shared bytes. I do not believe it has the proportional set size option. Perhaps there is a nice third-party utility for it. If it changes the order of magnitude of the memory usage I would be surprised since the size on disk of all of the binaries is less than the private set anyway, but if it does then I stand corrected.