A mentally-ill young woman who stabbed a man with a history of "compulsive violence" because she feared he was about to rape her has been jailed for at least three years for his manslaughter.

Karyna Hollaway, 24, sobbed in the dock of the Supreme Court in Sydney on Friday when Justice Derek Price ruled she would be eligible for parole in June next year due to her time already spent in custody for the manslaughter of 61-year-old Alan Truran.

The court heard Ms Hollaway, who pleaded guilty to manslaughter, grabbed a knife and stabbed Mr Truran repeatedly after he came up behind her, grabbed her around the neck and told her, "You owe me", sometime after April 1, 2011.

Ms Hollaway had been staying at Mr Truran's home at Hornsby in northern Sydney after she was released from Hornsby Hospital.

The court was told Ms Hollaway was suffering from a drug-induced psychosis, believed a "chip" had been inserted in her body and was hearing voices at the time of the offence.

She said she thought she would be raped and killed after Mr Truran grabbed her, so she took a knife and stabbed him several times.

Police discovered his badly-decomposed body, covered in towels, on the verandah of the house, on June 8, 2011.

Justice Price said he was satisfied Mr Truran had tried to attack Ms Hollaway and that she was suffering from drug-induced psychosis at the time.

"The honesty and reliability of the offender's account is supported by the deceased's history of sexual disinhibition and compulsive violence and the pre-existence of the mental illness of (Hollaway)," Justice Price said.

" ... I am satisfied the deceased's conduct in grabbing (Hollaway) around the neck and saying he was going to have his way led her to believe the deceased intended to sexually abuse her.

"The offender was not only provoked by the deceased but was (of the) belief it was necessary for her to do what she did in order to defend herself."

The court was told Ms Hollaway had been abused as a child, was made a ward of state, suffered a miscarriage at the age of 15 and had a lengthy history of self-harm and drug abuse.

Ms Hollaway thanked her lawyers after the maximum sentence of five years and four months was handed down.