The swap trick is often suggested as a solution. I don't think it's guaranteed to work on all platforms or all situations, but it's commonly recommended so I'd give it a try.
Code:
std::vector<int> my_data(50000);
my_data.clear(); // empty vector with high capacity
// swap trick:
my_data.swap(std::vector<int>());
// or
std::vector<int>().swap(my_data);
Basically it swaps with a newly constructed vector that presumably has much smaller capacity. The vector swap likely just swaps internal pointers rather than copying anything, so it is fast. That's why small capacity of the temporary becomes the small capacity of my_data, and my_data's big capacity gets switched to the temporary, which is immediately destroyed and frees the memory.