Subject: Re: port-amd64/32157 (pthread_create hangs netbsd)
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 01/18/2006 17:07:07
Synopsis: pthread_create hangs netbsd

State-Changed-From-To: open->analyzed
State-Changed-When: Wed, 18 Jan 2006 17:07:05 +0000
the reason for the hang is that the kernel datastructures (amaps) that
describe the memory allocated by the memory-leaking program fill up kmem_map,
and then the system goes into an infinite loop trying to allocate more
memory.  the allocation will always fail since we're out of virtual space,
but since it's an M_NOWAIT allocation, the system just tries again immediately.
it switches back and forth between the test program and the pagedaemon
and nothing else gets a chance to run.

the result is slightly better with NKMEMPAGES_MAX_DEFAULT increased to 1GB.
the system no longer hangs completely, existing processes can still run
but processes trying to allocate more memory get stuck a different way
that I haven't looked into yet.