Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2009 04:43:57 -0600
From:      Modulok <modulok@gmail.com>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Is this a kernel memory leak or a process memory leak?
Message-ID:  <64c038660909220343w3ae0607bq8aad1c370ebf00aa@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
List,

Maybe I'm just not that bright, but I have a question regarding the following:

man 3 getenv
<snip>
"Successive calls to setenv() or putenv() assigning a differently sized
value to the same name will result in a memory leak.  The FreeBSD seman-
tics for these functions (namely, that the contents of value are copied
and that old values remain accessible indefinitely) make this bug
unavoidable.  Future versions may eliminate one or both of these semantic
guarantees in order to fix the bug."
</snip>

This is a memory leak within the process which calls sentenv() or
putenv(), not a memory leak in the kernel, right? Like, if I called
putenv() a in a loop and then exited the process, the kernel will
reclaim that cluster-fuck of lost allocated memory, right? (If it's a
kernel leak that would be super retarded as any process could
affectively starve the kernel of memory. ) So it's a userland leak
right?

Anybody?
-Modulok-



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64c038660909220343w3ae0607bq8aad1c370ebf00aa>