How many peers can python use?

If I use python (32-bit) on a machine with, for example, 64Gb RAM, it will be able to use these 64Gb RAM. Or does it depend on the operating system?

+4
source share
2 answers

Python itself does not use any mechanisms for distribution outside the memory area for each process in the operating system. However, there are modules for this and tools. Therefore, the answer "depends on how much work you are willing to do."

+8
source

Python can use all the memory allocated to it. The OS allocates memory and usually has restrictions on each process, but there are commands to control these restrictions. (for example, "ulimit" on unix). But then most OSs use virtual memory, so the OS and its processes can use more virtual memory than the available physical memory. Thus, it is possible that the python program uses more physical memory. But the OS virtual memory system controls which pages are in physical memory and which pages are unloaded to disk. Thus, you can โ€œuseโ€ 64 GB of memory, but only a fraction of the most recently used pages are actually in physical memory at any time. And some of this physical memory will contain parts of the operating system that work often, such as virtual memory allocation functions. In addition: the memory allocated for the process is shared and allocated differently (for example, heap and stack space). Thus, you may have a shortage of memory for one, while in memory there is still a lot of unused memory. So it depends on what you mean by โ€œuse,โ€ and also (as another published one said) โ€œhow much work you are willing to do.โ€ You can probably get 64 GB, but you are unlikely to be able to โ€œuseโ€ all of the physical memory unless you are using the embedded system in which you are working as part of the OS.

+1
source

Source: https://habr.com/ru/post/1500524/


All Articles