N8: Stop the soak player holding old islands, and count live islands
The soak's client memory growth (17 to 20 MB, about five islands, in some processes) came from SoakPlayer keeping a strong reference to the last world it played on. It let go only when its client next asked it for a command on the new world, so finished islands stayed alive across a match change. It now keeps only the island's seed. LiveCount counts live Simulations and SimGrounds, which are made on worker threads too, so it is thread-safe. The soak clients log the counts, and the soak report fails if, a minute into a match, any island is alive that isn't a client's world or one being made. That makes a leak name itself instead of showing up as bytes. Refs #39 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -165,6 +165,14 @@ func _client_growth(lines: Array[Dictionary]) -> int:
|
||||
var worst: int = 0
|
||||
for process: int in by_process:
|
||||
worst = maxi(worst, _judge(by_process[process], "client process %d" % process))
|
||||
# A minute into each match, every island alive must be a client's world or one being
|
||||
# made. Anything more is an island nothing should still hold (#39).
|
||||
for record: Dictionary in lines:
|
||||
if String(record.get("event", "")) != "memory_late":
|
||||
continue
|
||||
var extra: int = int((record.get("worlds", {}) as Dictionary).get("extra_islands", 0))
|
||||
if extra > 0:
|
||||
_fail("client process %d still held %d islands beyond its clients' worlds in match %d" % [int(record.get("_process", 0)), extra, int(record.get("match", -1))])
|
||||
return worst
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user