Depending on where you live, you could store the password in a safety deposit box and then in your will specify who will become the owner of the safety deposit box on your death.
Gmail has a dead man's switch where another person becomes the owner of your account if you haven't logged in for x years. You could store your password in that account and log in every once in a while. Of course, Gmail would know your password now.
You could also split your encryption key into n pieces and give each numbered piece to someone you trust. While it is still possible they could access your account while living, they'd all have to cooperate to get your account.