Adding GetTotalPhysicalMemory() function (Issue #24652)

20 views
Skip to first unread message

Blake-Madden

unread,
Jun 28, 2024, 9:28:53 AM6/28/24
to wx-...@googlegroups.com, Subscribed

Would adding a GetTotalPhysicalMemory() function (which would return the size of installed RAM in bytes) be useful? I have this implemented for MSW, macOS, and remaining Unices if anyone would like for me to add this. I use this for logging system information for crash reports myself; perhaps others would to.

If so, where would be the best place for it? Perhaps wxPlatformInfo, although this isn't arguably a platform feature. Or it could be a global wxGetTotalPhysicalMemory() function.

P.S.
MS calls it "physically installed system memory" (https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getphysicallyinstalledsystemmemory?redirectedfrom=MSDN), hence the API that I suggest. I could say GetTotalRAM() instead.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24652@github.com>

VZ

unread,
Jul 1, 2024, 10:12:54 AM7/1/24
to wx-...@googlegroups.com, Subscribed

We have a global wxGetFreeMemory() function, so adding a new function for this wouldn't be out of place, but maybe we should indeed add some wxSystemHardwareInfo similar to wxPlatformInfo to avoid having multiple free functions — especially if we plan to add more of them or if its implementation can reuse some parts of wxGetFreeMemory() (which is probably the case for Windows, where we could use GlobalMemoryStatusEx() for both).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24652/2200263199@github.com>

Blake-Madden

unread,
1:49 PM (9 hours ago) 1:49 PM
to wx-...@googlegroups.com, Subscribed

Closed #24652 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/24652/issue_event/22956954206@github.com>

Reply all
Reply to author
Forward
0 new messages