Re: [Gluster-devel] Gluster statedumps and mallinfo

2017-07-05 Thread Vijay Bellur

On 07/03/2017 05:55 AM, Raghavendra Gowdappa wrote:

Hi,

Recently I observed one of the mallinfo fields had a negative value.

DUMP-START-TIME: 2017-06-09 10:59:43.747440

[mallinfo]
mallinfo_arena=-1517670400
mallinfo_ordblks=8008214
mallinfo_smblks=0
mallinfo_hblks=1009
mallinfo_hblkhd=863453184
mallinfo_usmblks=0
mallinfo_fsmblks=0
mallinfo_uordblks=1473090528
mallinfo_fordblks=1304206368
mallinfo_keepcost=2232208

As seen above mallinfo_arena is negative.

On probing further I came across posts that said mallinfo is not the ideal 
interface to get metadata about memory allocated by malloc [1]. Instead there 
were two alternatives - malloc_stats and malloc_info - suggested.


Good find!



* what among the above gives accurate and simple explanation about memory 
consumption of glusterfs?
* Should we deprecate mallinfo and just retain malloc_stats and malloc_info 
outputs? IOW, which among these need to be retained in statedump?


Yes, let us deprecate mallinfo() on platforms that support malloc_info().

man 3 malloc_info states:

"The malloc_info() function is designed to address deficiencies in 
malloc_stats(3) and mallinfo(3)."


Hence adding malloc_info() to statedump looks like a better option to me.

Regards,
Vijay



Since I've limited understanding of glibc memory allocator, I am reaching out 
to the wider community for feedback.

[1] http://udrepper.livejournal.com/20948.html

regards,
Raghavendra
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel



___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] Gluster statedumps and mallinfo

2017-07-03 Thread Raghavendra Gowdappa
Hi,

Recently I observed one of the mallinfo fields had a negative value.

DUMP-START-TIME: 2017-06-09 10:59:43.747440

[mallinfo]
mallinfo_arena=-1517670400
mallinfo_ordblks=8008214
mallinfo_smblks=0
mallinfo_hblks=1009
mallinfo_hblkhd=863453184
mallinfo_usmblks=0
mallinfo_fsmblks=0
mallinfo_uordblks=1473090528
mallinfo_fordblks=1304206368
mallinfo_keepcost=2232208

As seen above mallinfo_arena is negative.

On probing further I came across posts that said mallinfo is not the ideal 
interface to get metadata about memory allocated by malloc [1]. Instead there 
were two alternatives - malloc_stats and malloc_info - suggested.

With all the three information taken statedump looks as below:
DUMP-START-TIME: 2017-07-03 06:56:35.991499

[malloc_stats]
Arena 0:
system bytes = 622592
in use bytes = 498320
Arena 1:
system bytes = 135168
in use bytes =   2224
Arena 2:
system bytes = 135168
in use bytes =   2400
Arena 3:
system bytes = 135168
in use bytes =   2256
Arena 4:
system bytes = 135168
in use bytes =   2256
Arena 5:
system bytes = 135168
in use bytes =   2256
Arena 6:
system bytes = 135168
in use bytes =   2256
Arena 7:
system bytes = 135168
in use bytes =   2256
Arena 8:
system bytes = 135168
in use bytes =   2256
Arena 9:
system bytes = 704512
in use bytes = 668864
Total (incl. mmap):
system bytes =   17334272
in use bytes =   1668
max mmap regions =  7
max mmap bytes   =   14925824

[malloc_info]
































































































































[mallinfo]
mallinfo_arena=622592
mallinfo_ordblks=4
mallinfo_smblks=0
mallinfo_hblks=7
mallinfo_hblkhd=14925824
mallinfo_usmblks=0
mallinfo_fsmblks=0
mallinfo_uordblks=498320
mallinfo_fordblks=124272
mallinfo_keepcost=123776

The questions now are

* what among the above gives accurate and simple explanation about memory 
consumption of glusterfs?
* Should we deprecate mallinfo and just retain malloc_stats and malloc_info 
outputs? IOW, which among these need to be retained in statedump?

Since I've limited understanding of glibc memory allocator, I am reaching out 
to the wider community for feedback.

[1] http://udrepper.livejournal.com/20948.html

regards,
Raghavendra
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel