EXCLUSIVE

9:45 PM PT -- The L.A. County Coroner says Getty was "not feeling well" over the last couple of months, and had a doctor's appointment scheduled for Wednesday. The Coroner would not elaborate on what, if anything, was bothering Getty.

He added ... prescription meds were found on scene, but it was unclear if Getty had taken any of them.

The grandson of J. Paul Getty was found dead Tuesday and TMZ has learned his ex-girlfriend is currently being detained as a possible witness/suspect. Cops tell us they are handling this as a death "under suspicious circumstances."

We're told he suffered a traumatic injury to the rectal area and paramedics found significant bleeding.

Andrew Getty was found in the bathroom of his L.A. home at around 2 PM. Law enforcement sources tell us the ex-GF called 911 to report cardiac arrest.

Our sources say Andrew and his ex-girlfriend have a storied history with the LAPD. Cops have been to his residence 31 times, mostly for domestic disturbances. Our sources say they have both frequently been under the influence of drugs during the police visits.

We're told the drugs cops found in the past were prescriptions.

As for their relationship, we're told he has a restraining order against her and she has been placed under a 5150 psychiatric hold in the past, after injuring cops when they responded to the house. We're also told she's allegedly broken into Andrew's house on numerous occasions.