Your information was probably from www.familysearch.org
and their copying of Irish information.
The original source was the National Archives in Dublin as they have recently added more to their genealogy information.
Previously only the 1901/1911 census was digitized, then the prison records, then the Tithe Applotments fo 1820-1839.www.nationalarchives.ie
You should contact the National Archives as ask if their records include the released dates. Rathmines in the suburbs of Dublin so this was possibly the closest prison, people went to jail in those days for little, many were sent to Australia & Canada as convicts for stealing a loaf of bread. A great cheap way to have no cost labour for building the colonies.
You might be interested in a Short history of Ireland from the BBC, Northern Ireland. By Jonathan Bardon (Gill & Macmillan 2008) ISBN978-0-7171-4649-9
You should be able to order to a library or purchase the book. I don't know if the Four Courts Press might have one if you can't find them elsewhere.
How long he would of served for damaging a roof I have no idea but it would be longer than we now would think necessary. There are 14 Knox's in Dublin and outskirts, you would need the postal code to find Rathmines as I don't know that, I'm sure you can google that. Only Dublin proper has postal codes. There are Dublin 5's, 7's and 8.
Harvey is not in the 1901 Census for Dublin but there is a
Harvey Knox-Brown in Wexford age 30. He was a visitor at that house but there are no other occupants listed. Your Harvey would be about 54 by then.
InIllinois, did he emigrate to the US? have you found him in US passenger records or census records? www.familysearch.org
Although the name could be fairly common there is a Harvey
Knox born in Surry, England 1841 served from 1835-1857.
Even if this isn't him being in the military in the UK
could be being stationed anywhere including Ireland.
Ireland was full of people including the irish who served in the British Army. Dublin is a port as well.