He struggled with insomnia for along time, even before recording dark knight, he died due to a cocktail of drugs he used in an attempt to help himself to sleep.
He did finish recording everything for Dark Knight before he died, the Joker was 100% Heath Ledger.