Judge Paul Clark warned of the "evil" of heroin as he jailed a 55-year-old man who threw a package of the drug from a window during a police raid.
Nicholas Lambrianou, of Marlborough Road, Banbury, admitted possessing 280mg of the drug on June 28 when police raided his home, Oxford Crown Court heard.
Terence Woods, defending, said Lambrianou pleaded guilty at the first opportunity and asked for him to be fined rather than sent to prison.
But the judge said: "I take a very serious view of heroin. It is responsible for a large number of deaths in this county."
He sentenced Lambrianou to four months in prison and added: "You have got a long list of previous offences involving drugs.
This court knows all too well the evil this drug causes."
Alan Blake, prosecuting, said police had raided Lambrianou's home and arrested a number of other people.
The street value of the heroin Lambrianou threw from the window was 30, he said.
Mr Blake said the offence was committed while Lambrianou was on licence after being sentenced to 18 months in prison for possession of amphetamine and handling stolen goods.
Mr Blake said Lambrianou had been convicted of 63 offences, 19 of which related to drugs.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article