Telemachus

Telemachus

14.7k Downloads

Querying any resource kills the game

chistian95 opened this issue ยท 0 comments

commented

So I've found a weird issue. If you query "r.resourceCurrent" or "r.resourceCurrentMax", the game starts to lag a lot. Doesn't matter if you do it via WebSocket or HTTP API.

I have installed MemGraph to see memory usage and there is a notable spike in RAM usage. Also it starts to do more frecuent GC calls. After a few minutes, the memory usage and the GC calls starts to go up and up until the game is unplayable because it's stuttering.

let parametros = {
	"+": [
		"v.atmosphericPressure",
		"v.dynamicPressure",
		"v.verticalSpeed",
		"v.surfaceSpeed",
		"v.geeForce",
		"v.altitude",
		"v.sasValue",
		"o.ApA",
		"o.timeToAp",
		"o.PeA",
		"o.timeToPe",
//		"r.resourceCurrent[LiquidFuel]",
//		"r.resourceCurrent[SolidFuel]",
//		"r.resourceCurrentMax[LiquidFuel]",
//		"r.resourceCurrentMax[SolidFuel]",
		"f.throttle",
		"n.heading2",
		"n.pitch2",
		"n.roll2",
		"p.paused"
	],
	"rate": 500
};	

That's my list of subscriptions for telemachus. Notice how the reources are commented out.
If I start a web socket with those parameters, everything works nice and awesome. But the moment I add any of those four commented parameters, the game starts to lag.

Here I'm in orbit with a Probodobodyne HECS2 core. The vessel only has a couple solar panels and the antena. It doesn't have any fuel or engines.
You can see the memory usage is rather normal with a few GC calls that don't lag the game. It has been running for 15 minutes or so.
(I'm connected via telemachus and querying all the data except for the resources)

image

And this is the moment when I add a resource to the query list. You can clearly see the spikes and the GC calls going crazy.

image

Closing my web browser has no effect. The lag spykes are still happening and the only way to go back to normal is restarting the game.