A twin tower cooler like the NH-D15 which you mentioned will be about the best there is.
There are other such units.
One potential issue is compatibility.
Your 34mm ram is not going to cause any issues in that respect.
Nor will you have a problem with height; even the tallest are 165mm.
But, some motherboards will position the cpu socket too close to the first pcie slot.
A cooler can impact a graphics card backplate.
Noctua has some extensive charts on
compatibility and suitability for their coolers.
For suitability with a i7-7700K:
https://ncc.noctua.at/cpus/model/Intel-Core-i7-7700K-288
For motherboard compatibility, enter your motherboard:
https://ncc.noctua.at/motherboards
The NH-D15s is a high compatibility version which is a touch offset from the socket, and that would be a safe choice.