Rapper Wiz Khalifa, who like Miller grew up in Pittsburgh and was close to him, tweeted on Friday: "Praying for Mac's family and that he rest easy".
In May, he was arrested for a DUI and hit and run after crashing into a power pole and fleeing the scene.
Grande and Miller's two-year relationship ended earlier this year, with the singer confirming the split in May.
Mac had always been open about his struggles with substance abuse in his music, in particular his largely autobiographical 2014 mixtape, Faces. He was 19 when he released his YouTube "Blue Slide Park" album on November 8, 2011.
Mac and Ariana performed their duet The Way at One Love Manchester after the terror attack on one of Ariana Grande's shows.
"This is one of my best friends in the whole world and favorite people on the planet Malcolm McCormick", the 24-year-old "Sweetener" singer wrote at the time, sharing a snap of the pair holding hands. "I want to be able to have good days and bad days", he said. Trump hailed Miller as "the new Eminem" - the most famous white rapper.
The influential rapper's fifth studio album Swimming was announced on 13 July and released early last month.
Ariana hasn't spoken out about the tragedy but sources from ET say she is devastated by the loss. "So yeah I think that is really what sparked me doing other drugs because I hate being sober, I wanted a drug to do".
"Mac was a hugely gifted and inspiring artist, with a pioneering spirit and a sense of humor that touched everyone he met", Tom Corson, Co-Chairman and COO of Warner Bros.
However the musician, whose break came with releasing mixtapes in his late teens, had recently spoken of the burden that fame brought him.