NSW prisons are packed to the rafters, prompting a warning that things are only to get worse.

The state’s prison population hit a record high of 12,729 inmates as of December – up 16 per cent over the past two years.

With the tightening of bail laws, most of that is attributable to offenders being refused bail.

Added to that there’s been a rise in police-recorded offences, the Bureau of Crime Statistics and Research says in its latest report.

The prison officers union warns there’ll be another 1700 inmates in the system within the year.

The Public Service Association wants new facilities constructed sooner rather than later and has singled out the Grafton complex, which is due to be finalised by 2020.

“You have to put these people somewhere unless you’re going to move them to another state,” PSA general secretary Stewart Little told said on Monday.

Mr Little says short-term “pop-up jails” could be needed to house maximum-security prisoners together.

“It creates tension and it increases risk.”

Opposition corrections spokesman Guy Zangari is calling on the government to act quickly with 2017 shaping up as a horror year.

He pointed to a number of incidents in prison including the beating death of a 77-year-old inmate with a sandwich maker in his cell and the Bathurst riot earlier this month.

“Cramming prisoners into cells is not the solution – it’s a dangerous recipe for disaster,” Mr Zangari said in a statement.

However, the growth rate of the population appears to be slowing.

While the average annual rate of growth in the year to December 2015 was 11.7 per cent, this has dropped to 3.8 per cent in the 12 months to December 2016, the bureau said.

Meanwhile, the number of juveniles in custody has been falling rapidly over the past five years.

There are now 250 juveniles in custody, a drop of 38 per cent from a peak of 405 detainees in June 2011.