Bug 13368

Summary: Memory leak in -current pthreads select() implementation
Product: Base System Reporter: steve <steve>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description steve 1999-08-25 05:20:01 UTC
	FreeBSD's pthreads implements select() internally as poll().  In doing this,
	it dynamically allocates memory (one per thread) to store the pollfd struct.
	While subsequent calls to poll() in the same thread will reuse this memory,
	it is never free()ed when the thread is exited.

Fix: Applying the following patch to uthread_exit.c fixed the steady increase in
	memory:

How-To-Repeat: 
	This problem can be seen in threaded applications that frequently spawn
	threads (one per transaction, for example) that call select().  Memory usage
	for this process will steadily increase over time.
Comment 1 dt freebsd_committer freebsd_triage 1999-08-31 21:18:18 UTC
State Changed
From-To: open->closed

Suggested patch committed, thanks.