your best bet for a cross-platform solution is to use the psutil package (available on PyPI).
import psutil
psutil.virtual_memory().total # total physical memory in Bytes
Documentation for virtual_memory
is here.
More Related Contents:
- Python subprocess.Popen “OSError: [Errno 12] Cannot allocate memory”
- How to limit the heap size?
- How do I read a large csv file with pandas?
- How do I profile memory usage in Python?
- Why does multiprocessing use only a single core after I import numpy?
- Does Python have a stack/heap and how is memory managed?
- Shebang Notation: Python Scripts on Windows and Linux?
- python-dev installation error: ImportError: No module named apt_pkg
- Ensure a single instance of an application in Linux
- Force python to use an older version of module (than what I have installed now)
- How would I build python myself from source code on Ubuntu?
- Set chrome browser binary through chromedriver in Python
- more efficient way to calculate distance in numpy?
- Can Python select what network adapter when opening a socket?
- Python: How to read huge text file into memory
- Change default Python version from 2.4 to 2.6
- Splitting out the output of ps using Python
- Where can I find and install the dependencies for pygame?
- Sending a password over SSH or SCP with subprocess.Popen
- Show matplotlib plots (and other GUI) in Ubuntu (WSL1 & WSL2)
- Uninstall python built from source?
- PYTHONPATH not working for sudo on GNU/Linux (works for root)
- Pip is not working for Python 3.10 on Ubuntu
- Are strings pooled in Python?
- Get mouse deltas using Python! (in Linux)
- Could not find or load the Qt platform plugin “xcb”
- Python multiprocessing memory usage
- How to move .conda from one folder to another at the moment of creating the environment
- Python – Trap all signals
- Why Python `Memory Error` with list `append()` lots of RAM left