Multiple choice technology programming languages

How can I tell how much memory my system has?

  1. Use getmemory()

  2. Use sysctl()

  3. Use freemem()

  4. Use malloc()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The sysctl() system call is used to query and modify kernel parameters, including system memory information. Options A and C refer to non-standard functions, while malloc() is for memory allocation, not querying system memory. On modern Linux, /proc/meminfo is also commonly used.