[Gluster-devel] Gluster statedumps and mallinfo

Vijay Bellur vbellur at redhat.com
Wed Jul 5 19:18:41 UTC 2017


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 at gluster.org
> http://lists.gluster.org/mailman/listinfo/gluster-devel
>



More information about the Gluster-devel mailing list