[MDEV-16740] server memory stats as reported by "mysqladmin debug" are incorrect when server memory is large Created: 2018-07-12  Updated: 2023-04-27

Status: Confirmed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.2.14
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Rick Pizzi Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File MDEV-16740.tgz     File debug.prt     File fast.prt    

 Description   

When issuing "mysqladmin debug" on servers with large amounts of memory (eg 128G) the memory counters are incorrect. There are negative numbers, which seem to suggest that some counters are wrapping around.

Eg:

Memory status:
Non-mmapped space allocated from system: -824467456
Number of free chunks:                   970783
Number of fastbin blocks:                628
Number of mmapped regions:               76
Space in mmapped regions:                -485408768
Maximum total allocated space:           0
Space available in freed fastbin blocks: 30304
Total allocated space:                   879918896
Total free space:                        -1704386352
Top-most, releasable space:              10123968
Estimated memory (with thread stack):    -1265025024
Global memory allocated by server:       8696831768
Memory allocated by threads:             52050928



 Comments   
Comment by Matthias Leich [ 2018-07-17 ]

Testing box: 196 GB RAM and Linux
Maximum setting tried: innodb-buffer-pool-size=100000000000

I can confirm that negative numbers show up for
10.2.17 compiled without debug
10.2.17 compiled with debug
10.3.9 compiled with debug

No confirmation for
10.2.17 compiled debug + ASAN but
Non-mmapped space allocated from system: 0 <---------------
and similar.

10.1.35 compiled with debug but
Non-mmapped space allocated from system: 0 <----------------
and similar.

10.3.9 compiled with debug
innodb-buffer-pool-size=50000000000
Non-mmapped space allocated from system: 1981870080
innodb-buffer-pool-size=100000000000
Non-mmapped space allocated from system: -342142976

Comment by Matthias Leich [ 2019-05-17 ]

10.2.25 commit cd16d6d518761d144844f9f6294744f2aa42c715 2019-05-17
debug.prt  -- my results on a build with debug
fast.prt   -- my results on a build without debug
The negative values start to show up somewhere between 50 and 100 GiB innodb_buffer_pool_size.
 
MDEV-16740.tgz -- Archive for replaying the problem
How to replay:
Have a strong box (my guess RAM > 100 GB) running Linux.
cd <source tree>/mysql-test
tar xvzf <path_to_archive>/ MDEV-16740.tgz
cd <tree with binaries>/mysql-test
<source tree>/mysql-test/MDEV-16740.sh
You will have to adjust the script.

Generated at Thu Feb 08 08:31:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.