The G-Lock was a space station formed when the luxury cruiser Cerberus became trapped whilst leaving a hyperspace tunnel in the year 2815. The authorities sealed off the tunnel, trapping the Cerberus and the other ships behind it, including the prison transport Montressor.
When the tunnel was reopened two months later and the emergency services sent in, all of the ships were deserted. This became known as the "Mystery of the Cerberus".
After the tunnel was reopened, the wrecks became a haven for dropouts, and eventually became a space station, i.e. the G-Lock (short for gridlock). In fact, the Arachnopods ate most of the occupants of the ships, and the rest were taken to the year 3012 by the Repulsion.
On the G-Lock, the Festival of Death was held there, and on it was the theme park ride the Beautiful Death. The Repulsion created zombies out of the people experiencing the Beautiful Death and used them to cause chaos around the G-Lock and transport the crew of the Cerberus into them. The Fourth Doctor was able to defeat the Repulsion, but the G-Lock subsequently had to be evacuated as the two centuries' worth of 'pressure' caused by its position in the tunnel finally reached a point where the hyperspace tunnel collapsed, although everyone on board escaped before the G-Lock was destroyed. (PROSE: Festival of Death)