Skip to content
@derockx

@derockx

#29,836 overall601 subs YouTube
Likes
8.5K
Comments
1
Top comment
8.5K
Creators
1

Top comment

For the nerds, the NT Kernel (windows) handles memory allocations differently than Linux. When an app requests memory, the NT Kernel will strictly check to see if it's below limits and reserve the entire requested amount. Linux does things more lazily, where it'll only assign physical pages when the app writes to the memory. In layman's terms, if Linux app requests 2gb memory and does nothing or uses very little, you will see a very small jump in usage. In Windows, task manager will report a 2gb jump in committed memory in the same scenario because it reserves that memory against your ram and pagefile, even if physical ram isn't used yet. When using languages that have a runtime and garbage collection, they normally allocate more memory than needed to keep their own pool of memory that the runtime can manage itself. So if the underlying app doesn't use much memory, there's a lot of waste in Windows due to the entire pool being reserved. Video decoding (so some cutscenes in games) is a highly, highly optimized path so wasted memory is not much, resulting in the outliers seen in the video. This behavior also means that Windows will not let you commit more memory then the system can actually back (I.e. physical + page file size) while Linux can overcommit and result in an app being killed from the OOM killer. This is a very brief tldr into a big rabbithole, but it's quite interesting for those who care. There's also differences in how shared libraries (like dlls vs so) are loaded which can cause differences in usage, often favoring Linux in efficiency. edit: since this is blowing up, the point of this comment isn't to necessarily defend one side or completely invalidate the test results, just wanted to add context to the results and mention there is a lot under the hood! as mentioned in one of the replies, the task manager *graph* shows in use memory so the comparison is still valid in that regard. This difference manifests itself most in high memory usage scenarios, so would love to see that tested.

8.5K likeson Linus Tech Tips

Does Linux use less RAM?

Tools for commenters