Chrus Chrus - 1 year ago 79
C++ Question

Does Microsoft psapi methods return bytes using decimal or binary notation?

So I just started a project thats been going on for a few years now. It uses Microsoft's psapi interface to obtain memory data. I started working on it under the assumption that the data we collected was stored in binary notation (i.e a kilobyte is 1024 bytes).

But I noticed that everything they already wrote was under the assumption that the data was in decinal notation (a kilobyte is 1000 bytes). When I asked noone knew which form the data was really in and so far my google searches hasn't shed any light on this.

More specifically we are using GetProcessMemoryInfo (

Edit after choosing answer: So I just had a misunderstanding about what a byte was in decimal vs binary (e.g. they're the same thing). I'm just surprised noone that I asked here corrected me. Anyways thanks for clearing it up

Answer Source

This API returns numbers of bytes. In other words, the question is based on the false premise that values are returned in kilobytes. The distinction you refer to between binary and decimal quantities applies to kilobytes, megabytes, gigabytes etc. It is a meaningless distinction for bytes.

Documentation can be found here:

You will see members of these structures described like this:


The peak working set size, in bytes.

I've only included one example, but they are all of the same form.

Now, if you choose to present these values as kilobytes, or megabytes, or whatever, you have freedom to use whatever definition you choose.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download