The current mlock functionality—locking each memory page that happens to contain a secret key—causes problems with tests (and possibly also in production) because it quickly reaches the limit of locked memory pages.
We need a special allocator that mlocks, zeroes and munlocks dedicated memory pages and allocates space for secrets in there: locked pages are a scarce resource and should be used exclusively for secrets.
See the discussion on #34, specifically #34 (comment), for more details and an initial suggestion of how such an allocator could look.
/cc @mbr, @DrPeterVanNostrand