Mulligan mentions the asylum in connection with his taunting
suggestion that Stephen has "g.p.i."—general
paresis of the insane, a consequence of tertiary syphilis.
Joyce's fictional interest in insanity parallels Ireland's
therapeutic interest in it. The country has a long history of
building hospitals for the care of the mentally ill. It also
has a long history of excessive consumption of alcohol, which
has been responsible for many referrals to mental hospitals.
As for the name "Dottyville," it is no child of
Mulligan's teeming brain. Harald Beck notes on JJON
that "The popular caricaturist Phil May (1864-1903) drew a
number of cartoons for Punch that refer to a lunatic
asylum he called ‘Dottyville’ (dotty as a colloquial adjective
for someone feeble in mind or silly was in popular use in
English by the 1880s)." Those cartoons in the 1890s gave rise
to a cultural meme. Beck quotes uses of the name in Frank
Richardson's 1905 novel Secret Kingdom, in a 1913
children's game ("Any player alighting on 'Dottyville Lunatic
Asylum' must wait there in accordance with instructions"), and
in a 1917 reference by Siegfried Sassoon to the "Craiglockhart
War Hospital, where he had been sent by the authorities as an
alternative to a court martial."
Later in the 20th century the Richmond Lunatic Asylum became
known more respectfully as the Grangegorman Mental Hospital,
one part of a complex of buildings called St. Brendan's
Psychiatric Hospital. The hospital complex has been
progressively decommissioned in the last two decades, however,
and much of it either lies in ruins or has been demolished.