[dpdk-dev] [PATCH v1] app/testpmd: add memory dump command

Morten Brørup mb at smartsharesystems.com
Fri Apr 3 18:34:37 CEST 2020


> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Stephen Hemminger
> Sent: Friday, April 3, 2020 6:09 PM
> 
> On Fri, 3 Apr 2020 14:29:06 +0100
> Ferruh Yigit <ferruh.yigit at intel.com> wrote:
> 
> > > +			socket_stats.heap_totalsz_bytes / 1.0e6,
> > > +			socket_stats.heap_allocsz_bytes / 1.0e6,
> > > +			(double)socket_stats.heap_allocsz_bytes * 100 /
> > > +			(double)socket_stats.heap_totalsz_bytes,
> > > +			socket_stats.heap_freesz_bytes / 1.0e6,
> > > +			socket_stats.alloc_count,
> > > +			socket_stats.free_count);
> >
> > This gives an output like [1], can you please divide to (1024*1024)
> to convert
> > byte to Mb, than it can give more clear numbers.
> 
> Agree, the standard is to use 1024*1024 for memory megabytes.

That was the old standard. It has been 1000*1000 so for a decade now.

1000000 is the internationally agreed standard for the MB (megabyte) unit. It has been adopted by all major standardization organs, and is the legally binding definition.

If you want to use 1024*1024, the correct unit is MiB (mebibyte). And in this case, it probably makes sense. Just use the correct MiB unit instead of the incorrect MB unit.

For further information, please also refer to:
https://en.wikipedia.org/wiki/Megabyte

> And 1000*1000 for bytes in networking.

Yes.


More information about the dev mailing list