VIKAS MR writes: > Hello, > > I had a question to ask the community. I have written as server and a client > using TCP. We have around thousands of clients contacting the server. For > each client connection I am opening a new thread to process the request. When > the client is done, the threads close and also the socket get freed up. > > The question is , I am doing a "shutdown(sock) and then close(sock). But > still I am seeing that with every client connection and closing the memory > consumption of the server is increasing. I am using plain simple pmap -x pid > to see the memory usage. > Is there any way to check(Dtrace or MDB) that the socket buffer being freed > ? Also does close free up the socket buffer itself ? > During the socket open can I give any option to free the buffer immediately ?
There's no application-space "buffer" involved here, and "pmap" doesn't show you anything about the kernel buffers used for a socket. If you're seeing memory space usage grow according to "pmap -x", then it's possible that your application just has an ordinary malloc(3C) memory leak. It's also possible that you're looking at perfectly normal operation. One way to tell the difference is to use a debugging allocator, such as libumem. See libumem(3LIB) and umem_debug(3MALLOC) for more information. -- James Carlson, Solaris Networking <[email protected]> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677 _______________________________________________ networking-discuss mailing list [email protected]
