G
G
goodman777072020-07-18 13:18:30
linux
goodman77707, 2020-07-18 13:18:30

How is memory in RAM measured?

I have 8GB memory.
I run this command and get:

dmidecode -t memory | grep -i size
  Size: 8192 MB
  Size: No Module Installed

I re-read a lot of things: somewhere it is written that it is in gigabytes, somewhere - in gibibytes. What is true?
If this is 8192 mebibytes, then 8589.935 megabytes = 8.589935 gigabytes.
If MB is megabytes, 8.192 gigabytes.

this command shows:
free --mega
              total        used        free      shared  buff/cache   available
Mem:           7252        4825        1035         176        1391        2139
Swap:          2119          38        2081

to find out how much the Linux kernel consumes:
grep Slab /proc/meminfo
Slab:             186476 kB

video memory:
glxinfo | egrep -i 'device|memory'
    Device: AMD RAVEN (DRM 3.37.0, 5.7.5-gentoo-x86_64, LLVM 10.0.0) (0x15dd)
    Video memory: 1024MB
    Unified memory: no
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 649 MB, largest block: 649 MB
    VBO free aux. memory - total: 2905 MB, largest block: 2905 MB
    Texture free memory - total: 649 MB, largest block: 649 MB
    Texture free aux. memory - total: 2905 MB, largest block: 2905 MB
    Renderbuffer free memory - total: 649 MB, largest block: 649 MB
    Renderbuffer free aux. memory - total: 2905 MB, largest block: 2905 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 1024 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 649 MB
    GL_AMD_performance_monitor, GL_AMD_pinned_memory, 
    GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_memory_object, 
    GL_EXT_memory_object_fd, GL_EXT_packed_depth_stencil, GL_EXT_packed_float, 
    GL_MESA_texture_signed_rgba, GL_NVX_gpu_memory_info, 
    GL_AMD_pinned_memory, GL_AMD_query_buffer_object, 
    GL_EXT_gpu_shader4, GL_EXT_memory_object, GL_EXT_memory_object_fd, 
    GL_MESA_texture_signed_rgba, GL_MESA_window_pos, GL_NVX_gpu_memory_info, 
    GL_EXT_map_buffer_range, GL_EXT_memory_object, GL_EXT_memory_object_fd,

If all this is added up:
186476 kB = 186.476 megabytes
649 megabytes
7252 megabytes
= 8087.476 megabytes

So. it turns out that this is closer to 8192, which means that gigabytes are used. Maybe there's something I haven't figured out yet.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Saboteur, 2020-07-18
@goodman77707

GB - gigabytes
Gib - Gibibites

D
Dmitry Shitskov, 2020-07-18
@Zarom

Megabytes is

D
Dmitry Pavlov, 2020-07-18
@Stalker31

8192 is megabytes, 1 gigabyte = 1024 megabytes, respectively 8GB * 1024 = 8192 megabytes.

A
Araki_Satoshi, 2020-07-19
@Araki_Satoshi

Gigabyte, gigabit, now some kind of gibibyte has appeared, are you kidding me?!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question