I presume you are asking about a (somewhat) modern desktop or server OS.
The problem is: any answer can be invalid already when the result is returned. Reasons are other processes, threads, memory fragmentation, etc.
As others stated in comments already, an OS might even report more memory than available - inlcuding swap. The idea is that the allocated memory might only be sparsely used by a process, so only actually accesses memory pages will be provided as required, malloc() itself will not reserve any memory in advance.
It is also often not a good idea to allocate as much memory as possible, as that can result in exessive swapping or starving/thrashing other processes. So, just allocate the memory you actually need.
**Conclusion: ** Just forget about it! Allocate the memory you require, not more, not less. If you need dynamic memory, think about dynamic structures like lists and trees or use realloc()
(but use it well thought).
Sidenote:
Do not feel tempted to try allocated blocks in increasing size until you get NULL returned. This can easily result in fragmentation, and you might not be able to allocate even the previous largest block size (for similar reasons as stated above).
For embedded OSes, there might be a completely different answer.