Quick answer: Tie the Relay allocation lifecycle to the lobby: release or let the allocation lapse when the lobby is deleted, and stop the heartbeat so abandoned lobbies do not hold allocations.

If lobby creation works for a while and then starts erroring, you may be leaking Relay allocations that the service still counts against your quota. Release them on teardown. Here is how.

How to fix it

1. Release allocations on lobby close

When the host deletes a lobby or the match ends, also stop using the Relay allocation so it can lapse. Treat the allocation and the lobby as one lifecycle, created and torn down together.

2. Stop the heartbeat to let it expire

An allocation tied to a lobby kept alive by heartbeats persists; once you stop the heartbeat and delete the lobby, the allocation is no longer renewed and frees up against your quota.

3. Audit usage when creation fails

If CreateAllocationAsync or lobby creation starts throwing under load, check your project's active allocation count. A steadily climbing count with flat player numbers confirms a leak from un-torn-down sessions.

Catching the ones you can't reproduce

The hardest version of this to fix is the one you can't reproduce — it only happens on a player's hardware, OS, driver, or save state, under conditions that simply aren't present on your machine. A report that says “it crashed” or “it froze” gives you nothing to act on, so the bug survives release after release while quietly costing you players.

Automatic error capture closes that gap. Each failure arrives with its full stack trace, the device and OS, the build number, and a breadcrumb trail of what the player did right before it broke, so even a failure you have never seen becomes a specific, reproducible issue. Fold identical failures into one signature ranked by how many players each hits, and your worklist sorts itself worst-first instead of arriving as a stream of vague complaints.

This is where a tool like Bugnet earns its place. Its SDK captures every Unity error automatically with the full stack trace plus device, OS, memory, build, and game-state context, folds duplicates into one grouped issue with an occurrence count, and ties each to the build it first appeared on — so you fix the problem that hurts the most players first and confirm it is gone when its signature disappears from the next release.

A crash you can name from its stack trace is a crash you can usually fix in minutes.