Linux: Determining memory used by all connected socket send buffers

linuxsocket

Is there a way, on Redhat Linux, to determine the total amount of "real" memory that is being allocated to the send buffers for all currently connected sockets? I am troubleshooting a potential memory leak in a Java project, and am curious how send buffer size settings in my code translate to actual memory used by those buffers. Thanks for any help!

Best Answer

You might want to see that:

istvan:redhat$cat /proc/meminfo
MemTotal:      4151916 kB
MemFree:        415796 kB
Buffers:        344684 kB
Cached:        3039484 kB
SwapCached:          0 kB
Active:        1563304 kB
Inactive:      2017064 kB
HighTotal:     3276352 kB
HighFree:        86788 kB
LowTotal:       875564 kB
LowFree:        329008 kB
SwapTotal:     2040244 kB
SwapFree:      2040244 kB
Dirty:              12 kB
Writeback:           0 kB
AnonPages:      196352 kB
Mapped:          62228 kB
Slab:           133680 kB
PageTables:       6160 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   4116200 kB
Committed_AS:   748424 kB
VmallocTotal:   116728 kB
VmallocUsed:     44656 kB
VmallocChunk:    66548 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

And please note lsof

SIZE: The size of the file or the file offset, in bytes. (If available.) In the case of files that don’t have true sizes (eg., sockets, pipes), lsof displays the size of the content their kernel buffer descriptors.