4 ms·
That is difficult to believe. I unpacked Linux version of the app, Electron binary is 120 Mb, resources.pak is 8 Mb, ICU library is 10 Mb. How can a whole Elect
by codedokode 7y ago
That is difficult to believe. I unpacked Linux version of the app, Electron binary is 120 Mb, resources.pak is 8 Mb, ICU library is 10 Mb. How can a whole Electron app take just 74 Mb? The numbers don't add up.
To test it myself, I started the program (with --no-sandbox because it requires root privileges otherwise) and measured memory usage using smem:
$ sudo smem --userfilter=nobody -k --totals
PID User Command Swap USS PSS RSS
23365 nobody /tmp/.mount_markteqQvqZF/ma 0 6.3M 14.2M 37.7M
23388 nobody /tmp/.mount_markteqQvqZF/ma 0 46.6M 59.4M 90.9M
23363 nobody ./marktext --no-sandbox 0 53.3M 76.3M 118.4M
23392 nobody /tmp/.mount_markteqQvqZF/ma 0 121.1M 142.3M 183.0M
PSS (Potential Set Size) [1] numbers are additive unlike RSS, so we can sum them and get around 291 Mb of RAM. This counts pages, that are shared between several processes, only once.
Either MacOS uses RAM several times more effective than Linux, or Activity Monitor is showing incorrect numbers to make impression that Mac apps take less memory than apps on competing operating systems.
[1] https://en.wikipedia.org/wiki/Proportional_set_size https://en.wikipedia.org/wiki/Proportional_set_size