What if you write a custom allocator and pass that to the map. Your alocator could use clib's malloc and free. I'm pretty sure that's at the OS level.
Your allocator class only needs to implement the methods shown here: http://www.cplusplus.com/reference/std/memory/allocator/
Then when you define your std::map .. pass the allocator class as the 3rd template argument: http://www.cplusplus.com/reference/stl/map/
eg:
std::map<KeyType, ValueType, less<KeyType>, MyAllocator>
This link from this book also has some example code for making your own allocator: http://www.josuttis.com/libbook/memory/myalloc.hpp.html
Warning: I think the reason most allocators don't give memory back to the OS is that it's faster to hold on to it for later, than to give back to OS and get more every time; so you might see some speed inefficiencies.
Edit: Also found this neat looking howto: http://www.codeguru.com/cpp/cpp/cpp_mfc/stl/article.php/c4079