>From the man page for munlock:

       munlock  reenables  paging  for  the  memory  in the range
       starting at addr with length len bytes.  All  pages  which
       contain  a  part  of  the specified memory range can after
       calling munlock be moved to external swap space  again  by
       the kernel.

This is *not* the desired behaviour! When I munlock the part of the
track file that we've passed over, I don't want it to be paged out, I
want to forget about it. Ick. I guess I need to unmap it as well, to
indicate that I am really and truly finished with it and that it is no
longer in use. For some reason, I imagined that just unlocking it
would be enough, but I now see that the kernel still thinks I'm
interested in it. mlock marked some pages of the VM space as
non-pageable, and munlock marks as pageable. Totally symmetric, but I
didn't treat it that way.

Gosh. Talk about a memory leak.

--p

Reply via email to