SUNRPC memory usage problems

André Cruz andre.cruz@co.sapo.pt
Thu Jan 3 17:55:00 GMT 2008


Hello all.

I'm having some issues regarding memory usage on a program that acts  
as a multi-threaded RPC server on an unix socket. Basically it uses up  
all the system memory. :)

Libc version: the latest that comes with debian etch AMD64 arch
The program in question: Shibboleth SP (http:// 
shibboleth.internet2.edu/)

In pseudo-code what the program does is:
listen for incoming connection
	spawn thread to handle connection
		svc_create()
			svcfd_create()
			svc_register()
		loop on FD_ISSET(sock, &svc_fdset)
			select()
			svc_getreqset()

Looking at the libc code, svc_getreqset() seems to handle the teardown  
of the connection and freeing the resources, but running the program  
through valgrind's memcheck I get this result:

==9218== 8,468,928 bytes in 1,044 blocks are definitely lost in loss  
record 33 of 33
==9218==    at 0x4A1BDEB: malloc (vg_replace_malloc.c:207)
==9218==    by 0x62A9DD1: xprt_register (in /lib/libc-2.3.6.so)
==9218==    by 0x62AAD51: makefd_xprt (in /lib/libc-2.3.6.so)
==9218==    by 0x4058C5: SharChild::svc_create() (shar-utils.cpp:164)
==9218==    by 0x405B4A: SharChild::run() (shar-utils.cpp:130)
==9218==    by 0x405F90: shar_client_thread(void*) (shar-utils.cpp:89)
==9218==    by 0x60ACF19: start_thread (in /lib/libpthread-2.3.6.so)
==9218==    by 0x62855D1: clone (in /lib/libc-2.3.6.so)

This is just by calling the server 1044 times.... Is there a method I  
should be calling to free up more resources?
Is this the right list to be asking these questions? :)

Thanks,
André Cruz



More information about the Libc-alpha mailing list