Get System Memory in C

From: Alessandro Monopoli (tepossino_at_ammaza.com)
Date: 10/31/04


Date: Sun, 31 Oct 2004 12:16:53 GMT

Hi all,

I'm searching a PORTABLE way to get the available and total physical memory.

Something like "getTotalMemory" and it returns the memory installed on my PC
in bytes, and
"getAvailableMemory" and it returns the available memory in bytes.

Do you know is there's a C function, a c++ Object or anything else that
compiles in Linux and Windows to get these data?

Bye and thanks!
Alessandro



Relevant Pages

  • Re: Garbage collection
    ... nice-to-have feature to have also an GC attribute on type - to express an exclusion filter - but, imho, definitely do not rely on types _only_ to define the allocation policy. ... What I would like to see in Delphi it's a more advanced memory manager - but, anyway, I want to praise the Pierre's achievements - having a configurable GC and also, having a memory "defragmenter" to work in a separate thread in the low-activity periods of program. ... specifically to do the searching. ...
    (borland.public.delphi.non-technical)
  • Re: text box control
    ... Searching for airline flights isn't at all like searching ... To load and unload that form 200 times in one day, ... memory than if you just had a few forms that could stay in memory. ... modular approach.... ...
    (microsoft.public.vb.general.discussion)
  • Re: Issues with EventCombMT.exe
    ... locally on the DC's I'm searching, ... ExceptionAddress: 64302d31 ... The memory could not be %s. ... Dave Patrick ....Please no email replies - reply in newsgroup. ...
    (microsoft.public.windows.server.general)
  • Re: Question about ATA-2 and the Fixed Disk Parameter Table
    ... You can find it by searching in a certain ... range of the PC's memory using a tool like DEBUG. ... puts the numbers from CMOS in the FDPT, ...
    (comp.arch.storage)
  • Re: Efficient algorithm for finding duplicates in 56-bit number
    ... is rubbish, or the statement is rubbish, or critical information ... store all numbers + a hashing table in memory. ... the overhead is about 70% or so (less ... because searching it would be too slow. ...
    (comp.programming)